← SQL Playground
Top Earner Per Department
HardPremiumFor each department, return the department
name (as dept), the name of its highest-paid employee (as emp), and that salary. Order by department name.Schema
departments (id, name)
employees (id, name, department_id, salary, hire_date)
Loading editor…
Hints