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

Employees and Their Managers' Names

Easy Joins

Return each employee's name with their manager's name (NULL for the top manager). Order by employee id.

Table schema

Employees(id INT PRIMARY KEY, name VARCHAR(50), manager_id INT NULL)

Sample data

id | name | manager_id
1 | CEO | NULL
2 | VP | 1
3 | Dev | 2

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.