πŸ“Š MySQL
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Returns the second highest salary

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

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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
63
Total Visits
πŸ“½οΈ
9 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
85%
Success Rate