COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
SELECT * FROM Items ORDER BY Price ASCENDING
|
|
SELECT * FROM Items ORDER BY Price ASC
|
|
SELECT * FROM Items BY Price LOWEST TO HIGHEST
|
|
SELECT * FROM Items ORDER BY Price DESC
|
Detailed explanation-1: -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.
Detailed explanation-2: -To find the minimum value of a column, use the MIN() aggregate function; it takes as its argument the name of the column for which you want to find the minimum value. If you have not specified any other columns in the SELECT clause, the minimum will be calculated for all records in the table.
Detailed explanation-3: -With SQL, how can you return all the records from a table named “Persons” sorted descending by “FirstName”? Explanation: The SQL SELECT statement queries data from tables in the database.
Detailed explanation-4: -The MAX() function returns the largest value of the selected column.