Which SQL clause is used to sort the result set of a query? a) WHERE
b) ORDER BY
c) GROUP BY
d) HAVING
Which SQL clause is used to sort the result set of a query?
Share
The correct answer is b) ORDER BY.
The `ORDER BY` clause is used in SQL to sort the result set of a query based on one or more columns. You can specify whether to sort the results in ascending (ASC) or descending (DESC) order. For example:
SELECT * FROM students ORDER BY last_name ASC;
This will sort the students by their last names in ascending order. If you have more questions or need further assistance, feel free to ask!