Which sql keyword is used to sort the result set?
a. ORDER
b. SORT BY
c. ORDER BY
d. SORT
The answer to your question - which sql keyword is used to sort the result set is - The correct answer is option B (ORDER BY). ORDER BY keyword is used to sort the result-set and we can sort in either ascending or descending order. Here is the syntax to use ORDER BY keyword in SQL:
SELECT column_list
FROM TableNam
ORDER BY column_list ASC|DESC;
Here is the query if you want to sort the employees according to the salaries in the employee table.
SELECT Employee_name, Salary
FROM Employee
ORDER BY Salary