We use analytics and advertising cookies to understand how the site is used and whether our ads on Facebook and Instagram work. They are set only if you accept. See our Privacy Policy for details.
For each employee return 'name', department 'department_id', 'salary', and a 'salary_rank' that is 1 for the highest paid in the department, 2 for next, and so on. Use ROW_NUMBER and order results by 'department_id' then 'salary_rank'.