Unmatched Rows on Both Sides
Medium
Joins
List every employee with their department, including employees with no department and departments with no employees. Return employee_name and department_name (NULL where missing). Row order does not matter.
Table schema
Employees(id INT PRIMARY KEY, name VARCHAR(50), department_id INT NULL)
Departments(id INT PRIMARY KEY, name VARCHAR(50))Sample data
Employees:
id | name | department_id
1 | Alice | 1
2 | Bob | NULL
Departments:
id | name
1 | Engineering
2 | HR
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.