Best answer # Write your MySQL query statement below WITH t1 AS ( SELECT d.name Department, e.name Employee, salary, DENSE_RANK() OVER(PARTITION BY d.name ORDER BY salary DESC) rank_salary FROM Employee e JOIN Department d ON e.departmentId =d.id) SELECT Department, Employee, salary FROM t1 WHERE rank_salary