Compensation benchmarking needs the third highest distinct salary inside each department.
From payroll_records, return department and third_highest_salary. Departments with fewer than three distinct salaries must be omitted entirely.
Sample data
More Subqueries questions
Practising alone only goes so far — our live cohorts pair SQL depth with dashboards, agentic analytics projects and mock interviews.
Explore the program