EmpNo EName Salary DeptId E101 Sumit 60000 D01 E104 Jyoti 55000 D04 E105 Anand 50000 D05 E102 Pradeep 80000 D02 E103 Rakesh 70000 D03
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?
| EmpNo | EName | Salary | DeptId |
|---|---|---|---|
| E101 | Sumit | 60000 | D01 |
| E104 | Jyoti | 55000 | D04 |
| E105 | Anand | 50000 | D05 |
| E102 | Pradeep | 80000 | D02 |
| E103 | Rakesh | 70000 | D03 |
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
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.
Related questions:
2025: 16 May Shift 1
2025: 16 May Shift 1
2025: 15 May Shift 2
2026: 29 May Shift 1
2025: 14 May Shift 1