# Write your MySQL query statement below
SELECT D.Name AS Department, A.Name AS Employee, A.Salary AS Salary
FROM Department AS D, Employee AS A
WHERE (SELECT COUNT(DISTINCT(B.Salary)) AS RANK
FROM Employee AS B
WHERE B.Salary >= A.Salary and A.DepartmentId = B.DepartmentId) <= 3 AND A.DepartmentId = D.Id
ORDER BY A.DepartmentId, A.Salary DESC;