Examveda

Which one of the following sorts rows in SQL?

A. SORT BY

B. ALIGN BY

C. ORDER BY

D. GROUP BY

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: ALIGN BY - This is not a valid SQL keyword for any operation, including 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: 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.
Conclusion:
The SQL keyword that sorts rows in a query result set is Option C: ORDER BY. This clause 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.