All prompts are owned by LeetCode. To view the prompt, click the title link above.
First completed : June 07, 2024
Last updated : July 01, 2024
Related Topics : Database
Acceptance Rate : 53.51 %
# 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)