PostGreSQL easy solution
Intuition\nThink on previous problems and used then to solve this one.\n\n# Approach\nEasy using the WHERE clause.\n\n# Complexity\n- Time complexity:\nNone\n\n
# Intuition\nThink on previous problems and used then to solve this one.\n\n# Approach\nEasy using the WHERE clause.\n\n# Complexity\n- Time complexity:\nNone\n\n- Space complexity:\nNone\n\n# Code\n```\n-- Write your PostgreSQL query statement below\nSELECT d.Name AS Department, e.Name As Employee, e.Salary AS Salary\nFROM Employee e\nLEFT JOIN Department d ON e.DepartmentId = d.Id\nWHERE (d.Id, e.Salary) in (SELECT DepartmentId, max(Salary) FROM Employee GROUP BY DepartmentId)\n```
['PostgreSQL']