Which sql keyword is used to sort the result set?

259    Asked by Amitraj in SQL Server , Asked on Nov 16, 2022
a. ORDER
b. SORT BY
c. ORDER BY
d. SORT
Answered by Alexander Coxon

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


Your Answer

Interviews

Parent Categories