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

Join Shalyam Newsletter

Get exclusive insights with every issue: education, research and innovation news.

One email a week. Unsubscribe any time.