Getting everything ready for you…

Loading courses, problems and your progress. This takes just a moment.

0s

SQL practice › Window functions

Top Earner per Department

Hard · Window functions

For every department with employees, return the department name, the name of its highest-paid employee and their salary.

Hint

Number rows inside each department with ROW_NUMBER() and keep number 1.

Write your query on this page — it runs against the sample company database in your browser and is checked instantly.

Next problem: Running Revenue