Skip to main contentSkip to solution

Which query finds the second highest Salary from the table EMP?

Solution

✅ Correct Option: 2

The inner query SELECT MAX(Salary) FROM EMP\text{SELECT MAX(Salary) FROM EMP} returns the highest salary. The outer query then takes the maximum of all salaries strictly less than that value, which is the second highest salary.


Option 3: returns the top two salaries (both rows), not only the second highest.

Options 1 and 4: invalid SQL, since MAX\text{MAX} needs brackets and LIMIT = 2\text{LIMIT = 2} or ORDER BY Salary = 2\text{ORDER BY Salary = 2} is not valid syntax.

Keyboard Shortcuts

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