Problem Statement
When do you use a SELF JOIN?
Explanation
A SELF JOIN uses aliases to treat the same table as two roles. It helps express parent child links or supervisor employee relations.
Aliases are mandatory so the columns from each role can be referenced unambiguously.
Code Solution
SolutionRead Only
SELECT e.emp_id, e.name, m.name AS manager FROM employees e LEFT JOIN employees m ON m.emp_id = e.manager_id;
