Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 829 Bytes

_184. Department Highest Salary.md

File metadata and controls

34 lines (24 loc) · 829 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : June 07, 2024

Last updated : July 01, 2024


Related Topics : Database

Acceptance Rate : 53.51 %


Solutions

SQL

# Write your MySQL query statement below
SELECT d.name as 'Department',
        e.name as 'Employee',
        salary as 'Salary'
FROM Employee e RIGHT OUTER JOIN Department d ON e.departmentId = d.id
WHERE salary = (SELECT max(salary) FROM Employee WHERE Employee.departmentId = e.departmentId)