Leetcode Problem 1965. Employees With Missing Information

1965. Employees With Missing Information

Leetcode Solutions

UNION and NOT IN Approach

  • Select employee_id from the Employees table where the employee_id is not present in the Salaries table.
  • Use the UNION operator to combine the results with the next subquery.
  • Select employee_id from the Salaries table where the employee_id is not present in the Employees table.
  • Order the final result by employee_id in ascending order.

erDiagram
    Employees {
        int employee_id PK
        varchar name
    }
    Salaries {
        int employee_id PK
        int salary
    }

LEFT JOIN and IS NULL Approach

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...