A database table is defined as employees(name, salary). Which of the following SQL queries correctly returns the second highest salary in the table?
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
SELECT MAX(salary) FROM employees ORDER BY salary DESC LIMIT 2;
SELECT salary FROM employees WHERE salary = MAX(salary) - 1;
SELECT MIN(salary) FROM employees WHERE salary > (SELECT MIN(salary) FROM employees);
The verified answer and full solution are one login away
Every answer here is machine verified, with a step-by-step solution that teaches the method. Your login also unlocks a 7-question mock preview in the real exam interface.
Log in to see the answerMore sql questions