Which keyword sorts values in descending order?

Study for the SQL Basics Test. Improve your knowledge with multiple choice questions and detailed explanations. Prepare effectively to master SQL concepts!

Multiple Choice

Which keyword sorts values in descending order?

Explanation:
Sorting results in descending order is controlled by the DESC keyword. It tells the database to arrange values from highest to lowest (or from Z to A for text). The opposite direction is ASC, which orders from lowest to highest. The other terms shown aren’t used to control sort direction in standard SQL. For example: SELECT name, salary FROM employees ORDER BY salary DESC; This places the highest salaries first. If you omit the direction, ascending order is used by default.

Sorting results in descending order is controlled by the DESC keyword. It tells the database to arrange values from highest to lowest (or from Z to A for text). The opposite direction is ASC, which orders from lowest to highest. The other terms shown aren’t used to control sort direction in standard SQL. For example: SELECT name, salary FROM employees ORDER BY salary DESC; This places the highest salaries first. If you omit the direction, ascending order is used by default.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy