Unique Employee ID

2pts
Apple

Problem Statement

Large organizations often manage multiple identity systems. You are tasked with generating a report that maps every employee to their unique identifier, if one exists in the secondary system.

Write an SQL query to show the unique ID of each user. If a user does not have a unique ID, display null instead.

Rules:

  • The result should include the unique_id and the name of the employee.
  • Every employee present in the Employees table must appear in the output.
  • The order of the results does not matter.
Tests your understanding of
Basic SQL, Joins, LEFT JOIN and NULL Handling

Input Tables

employees
id(INTEGER)name(VARCHAR)
1Alice
7Bob
11Meghan
90Winston
3Jonathan
4Sarah
employee_uni
id(INTEGER)unique_id(INTEGER)
3101
11102
90103

Expected Output

unique_id(INTEGER)name(VARCHAR)
nullAlice
nullBob
102Meghan
103Winston
101Jonathan
nullSarah

Tags

EasyBasic SQLJoinsLEFT JOINNULL Handling
5-10 min
92%

Hints