Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.