Question
Easy

Consider the following SQL query: SELECT title, name FROM Employee ORDER BY title, name DESC; In output of above query the different titles are listed in _______ order and names of employees having same title are listed in _______ order.

1
Ascending, Ascending
2
Ascending, Descending
3
Descending, Ascending
4
Descending, Descending
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Database Management System (DBMS) & SQL
Topic: SQL
Correct Answer
Option B
Explanation

The correct option is (2): The ORDER BY clause in SQL is a fundamental tool used to specify the sequence in which the rows of the result set should appear. When multiple columns are specified, such as in ORDER BY title, name DESC;, the sorting is hierarchical: the first column, title, dictates the primary sort order. In standard SQL, if the sort direction (ASC for Ascending or DESC for Descending)…Read More