Easy to understand Solution for maximum Salary of each Department
Intuition\n Describe your first thoughts on how to solve this problem. \nFind MAX salary for each department\n# Approach\n Describe your approach to solving the
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nFind MAX salary for each department\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFirst find MAX salary for each department, that can be done only with employee table with departmentId & Salary. then filter that data using IN function to find the name of the person and his salary, use JOIN function with Department Table to identify the dept name\n\n# Complexity\n- Time complexity: 724 ms\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/* Write your PL/SQL query statement below */\nSELECT d.name AS Department, e.name AS Employee, Salary\nFROM Department d, Employee e\nWHERE d.id = e.departmentId\nAND (e.departmentId, Salary) IN (\n    SELECT departmentId, MAX(Salary) FROM Employee\n    GROUP BY departmentId)\n```
['MySQL', 'Oracle', 'MS SQL Server']