Databases · Junior · Question 72 of 75

Table employees(id, name, manager_id) stores each employee's manager. How do you list employees with their manager's name?

Explanation

This is a self-join; aliases make the two roles clear. LEFT JOIN keeps the top manager, who has no manager.

Further reading

Problem with a question

Databases · Junior · question 72

Test yourself

Take the Databases · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz