Skip to content

1965. Employees With Missing Information 👍

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SELECT Employees.employee_id
FROM Employees
LEFT JOIN Salaries
  USING (employee_id)
WHERE Salaries.salary IS NULL
UNION ALL
SELECT Salaries.employee_id
FROM Salaries
LEFT JOIN Employees
  USING (employee_id)
WHERE Employees.name IS NULL
ORDER BY 1;