Q. Which statement will return the second highest salary?
Code:
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
β
Correct Answer: (B)
Returns the second highest salary
Explanation: The subquery gets the highest salary; the outer query finds the max below that.