CBSE Class 12 Computer Science Question 66 of 78

Simple Queries in SQL — Question 20

Back to all questions
20
Question

Question 20

Consider the following query

SELECT * FROM employee ORDER BY salary ..............., name ...............;

To display the salary from greater to smaller and name in alphabetical order which of the following options should be used ?

  1. Ascending, Descending
  2. Asc, Desc
  3. Desc, Asc
  4. Descending, Ascending
Answer

Desc, Asc
Descending, Ascending

Reason — To display the salary from greater to smaller i.e., in descending order we use DESC or descending keyword and to sort name in alphabetical order i.e., in ascending order we use ASC or ascending keyword.