Full outer join emulation in MySQL + Alternate Quick and Intuitive Approach
Code\n\n# Write your MySQL query statement below\n# Emulating full outer join in SQL\nSELECT EMPLOYEE_ID FROM\n(SELECT E.EMPLOYEE_ID, NAME, SALARY FROM EMPLOYEE
# Code\n```\n# Write your MySQL query statement below\n# Emulating full outer join in SQL\nSELECT EMPLOYEE_ID FROM\n(SELECT E.EMPLOYEE_ID, NAME, SALARY FROM EMPLOYEES E\nLEFT OUTER JOIN SALARIES S ON E.EMPLOYEE_ID = S.EMPLOYEE_ID\nUNION \nSELECT S.EMPLOYEE_ID, NAME, SALARY FROM EMPLOYEES E\nRIGHT OUTER JOIN SALARIES S ON E.EMPLOYEE_ID = S.EMPLOYEE_ID) T\nWHERE NAME IS NULL OR SALARY IS NULL\nORDER BY employee_id\n\n# Alternate: Intuitive \nSELECT EMPLOYEE_ID FROM EMPLOYEES WHERE EMPLOYEE_ID NOT IN (SELECT EMPLOYEE_ID FROM SALARIES)\nUNION\nSELECT EMPLOYEE_ID FROM SALARIES WHERE EMPLOYEE_ID NOT IN (SELECT EMPLOYEE_ID FROM EMPLOYEES)\nORDER BY 1 ASC \n```
['MySQL']