Simple Solution using Full Join
\n# Approach\n Describe your approach to solving the problem. \nFor this we should know the FULL JOIN Combination of RIGHT and LEFT join, In first solution used
\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFor this we should know the FULL JOIN Combination of RIGHT and LEFT join, In first solution used FULL JOIN directly, In second Solution showed how it is working without FULL JOIN. Both will work.\n\n\n# Code\n```postgresql []\n-- Write your PostgreSQL query statement below\nSELECT COALESCE(t1.employee_id, t2.employee_id) AS employee_id\nFROM Employees t1 FULL JOIN Salaries t2\nON t1.employee_id = t2.employee_id\nWHERE t1.name IS NULL OR t2.salary IS NULL\nORDER BY employee_id \n```\n\n\n# Code\n```postgresql []\n-- Write your PostgreSQL query statement below\nWITH temp as (SELECT e.employee_id as emplyee_id_1, e.name as name_1, s.employee_id as employee_id_2, s.salary as salary FROM Employees e LEFT JOIN Salaries s ON e.employee_id = s.employee_id\nUNION\nSELECT e.employee_id as emplyee_id_1, e.name as name_1, s.employee_id as employee_id_2, s.salary as salary FROM Employees e RIGHT JOIN Salaries s ON e.employee_id = s.employee_id)\n\nSELECT COALESCE(emplyee_id_1, employee_id_2) as employee_id   FROM temp WHERE emplyee_id_1 IS NULL OR name_1 IS NULL OR employee_id_2 IS NULL OR salary IS NULL ORDER BY 1\n```
['PostgreSQL']