CBSE Class 12 Informatics Practices Question 10 of 90

Querying Using SQL — Question 3

Back to all questions
3
Question

Question 3

What will be the order of sorting in the given query?

SELECT emp_id, emp_name 
FROM person
ORDER BY emp_id, emp_name;

(a) Firstly on emp_id and then on emp_name

(b) Firstly on emp_name and then on emp_id

(c) Firstly on emp_id but not on emp_name

(d) None of the mentioned

Answer

Firstly on emp_id and then on emp_name

Reason — The ORDER BY emp_id, emp_name clause sorts the result set firstly by the emp_id column. If there are rows with the same emp_id, those rows are further sorted by the emp_name column.