Employees With Missing Info

ASKED IN INTERVIEW
2pts
HR Tech

Problem Statement

An HR database audit has revealed that some employee records are incomplete. Some employees have a name registered but no salary data, while others have salary data but no name registered.

Your task is to find the IDs of all employees who have missing information (either the name or the salary).

Rules:

  • Return the result table with a single column employee_id.
  • An employee is missing information if their ID appears in only one of the two main tables (Employees or Salaries).
  • Results must be sorted by employee_id in ascending order.
Tests your understanding of
Set Operations, Joins and Filtering

Input Tables

Employees
employee_id(INTEGER)name(VARCHAR)
2Crew
4Haven
5Kristian
Salaries
employee_id(INTEGER)salary(INTEGER)
576071
122517
463539
Departments
dept_id(INTEGER)dept_name(VARCHAR)
1Engineering
2Sales

Expected Output

employee_id(INTEGER)
1
2

Tags

EasyASKED IN INTERVIEWSet OperationsJoinsFiltering
10-15 min
70%

Hints