SQL Multiple choices


Total available count: 51
Subject - Databases
Subsubject - SQL

Which SQL keyword is used to sort the result-set?


 

 

 

 



C


Solution:-

The SQL ORDER BY Keyword
The ORDER BY keyword is used to sort the result-set in ascending or descending order. The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword.

ORDER BY Syntax is as follows,

SELECT column1, column2, ...FROM table_name ORDER BY column1, column2, ... ASC|DESC;

ORDER BY Example is as follows,
The following SQL statement selects all courses from the "Slightbook" table, sorted by the "Subject" column:

SELECT * FROM Slightbook ORDER BY Subject;

 




Next 5 multiple choice(s)

1

Which SQL statement is used to return only different values?

2

With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?

3

With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

4

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true

5

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

Comments