Examveda

To sort the results of a query use:

A. SORT BY.

B. GROUP BY.

C. ORDER BY.

D. None of the above is correct.

Answer: Option C

Solution (By Examveda Team)

Option A: SORT BY. - This is not a standard SQL keyword for sorting rows. The correct keyword for sorting rows in SQL is "ORDER BY".
Option B: GROUP BY. - The "GROUP BY" clause is used to group rows that have the same values into summary rows, typically for aggregate functions like SUM or COUNT, not for sorting.
Option C: ORDER BY. - This is the correct answer. The "ORDER BY" clause in SQL is used to sort the result set by one or more columns in ascending or descending order.
Option D: None of the above is correct. - This option is incorrect because Option C ("ORDER BY") is the correct answer for sorting query results in SQL.
Conclusion:
To sort the results of a query in SQL, you use the Option C: ORDER BY clause. This allows you to specify the column(s) by which you want to sort the results and the order (ascending or descending). Therefore, the correct answer is ORDER BY.

This Question Belongs to Database >> Introduction To SQL

Join The Discussion

Related Questions on Introduction to SQL

The SQL WHERE clause:

A. limits the column data that are returned.

B. limits the row data are returned.

C. Both A and B are correct.

D. Neither A nor B are correct.