Problem 3338 · Hard

Second Highest Salary II

teaching summary, not the official statement: within each department, find the employees whose salary is the second-highest distinct value. Departments without two distinct salaries drop out. Verify the official rules before relying on this.

Open the interactive visualisation