Skip to main contentSkip to solution

EmpNoENameSalaryDeptId
E101Sumit60000D01
E104Jyoti55000D04
E105Anand50000D05
E102Pradeep80000D02
E103Rakesh70000D03

Consider the table 'EMPLOYEE' given above.

Which SQL query will display all employees having salary more than 60000 arranged in descending order by salary amount?

Solution

✅ Correct Option: 1

Option 1 filters rows with a WHERE clause, which is the correct way to select individual rows by a condition. SALARY>60000 keeps only employees earning more than 60000, and DESC sorts the result from the highest salary to the lowest.

Here that gives Pradeep (80000) and Rakesh (70000). Sumit earns exactly 60000, so he is excluded by >.


Options 2 and 4: HAVING is used to filter groups after GROUP BY, not individual rows, so it is wrong here. Option 4 also has an invalid DESC-1.

Option 3: SALARY<60000 selects employees earning less than 60000, which is the opposite of what is asked.

The keyword is normally written ORDER BY with a space. The question's ORDERBY is a typo shared by all four options, so it does not separate them.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question