A

Admin • 802.91K Points
Coach

Q. Which statement will return the second highest salary?

Code:
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
  • (A) Returns average salary
  • (B) Returns the second highest salary
  • (C) Returns lowest salary
  • (D) Returns all salaries except highest
  • Correct Answer - Option(B)
  • Views: 7
  • Filed under category MySQL
  • Hashtags:

Explanation by: Admin
The subquery gets the highest salary; the outer query finds the max below that.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.