Easy Solution. No joins. GROUP BY is enough. 916ms
select\n    d.Name, e.Name, e.Salary\n    from\n    Department d,\n    Employee e,\n    (select MAX(Salary) as Salary,  DepartmentId as DepartmentId from Employ
    select\n    d.Name, e.Name, e.Salary\n    from\n    Department d,\n    Employee e,\n    (select MAX(Salary) as Salary,  DepartmentId as DepartmentId from Employee GROUP BY DepartmentId) h\n    where\n    e.Salary = h.Salary and\n    e.DepartmentId = h.DepartmentId and\n    e.DepartmentId = d.Id;
[]