Self Join
A Self Join is a regular join, but the table is joined with itself. This is useful for hierarchical data or comparing rows within the same table.
You must use table aliases to distinguish the two instances of the table.
SELECT A.name AS Employee, B.name AS Manager
FROM employees A
JOIN employees B ON A.manager_id = B.id;
Task:
Find the name of each employee and their manager's name.