Write a solution to report the IDs of all the employees with missing information. The information of an employee is missing if:
Return the result table ordered by employee_id
in ascending order.
The result format is in the following example.
UNION
하는 문제Employees
에 있지만 Salaries
에 없는 id
를 찾고RIGHT JOIN
을 사용한다.SELECT e.employee_id FROM Employees as e
LEFT JOIN Salaries as s USING(employee_id)
WHERE salary IS NULL
UNION
SELECT s.employee_id FROM Employees as e
RIGHT JOIN Salaries as s USING(employee_id)
WHERE name IS NULL
ORDER BY employee_id;