Multiple choice technology databases

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

  1. ORDER

  2. SORT

  3. SORT BY

  4. ORDER BY

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The ORDER BY clause is the correct SQL keyword combination for sorting query results. 'ORDER' or 'SORT BY' alone are not valid SQL syntax for sorting.

AI explanation

To answer this question, you need to understand how to sort the result-set in SQL.

Option A) ORDER - This option is incorrect because the keyword "ORDER" alone is not used to sort the result-set in SQL.

Option B) SORT - This option is incorrect because the keyword "SORT" alone is not used to sort the result-set in SQL.

Option C) SORT BY - This option is incorrect because the keyword "SORT BY" is not used to sort the result-set in SQL. The correct keyword to use is "ORDER BY".

Option D) ORDER BY - This option is correct because the keyword "ORDER BY" is used in SQL to sort the result-set in ascending or descending order based on one or more columns.

The correct answer is D. This option is correct because "ORDER BY" is the SQL keyword used to sort the result-set.