Practice / Data & AI

SQL: top 2 salaries per department

Easy · Whiteboard

Tables employees(id, name, salary, dept_id) and departments(id, name). Return the two highest-paid employees in each department. What happens with ties?

Create a free account to answer it and get scored on what a strong answer covers.