Select d.Name as Department, e.Name as Employee, e.Salary
from Department as d join Employee as e on e.DepartmentId = d.Id
group by d.Name
having e.Salary = Max(e.Salary)
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.