Type the self-join that pairs each employee with their manager:
Type the self-join that pairs each employee with their manager:
Answer
SELECT e.name AS employee, m.name AS manager FROM employees e JOIN employees m ON m.emp_id = e.manager_id ORDER BY e.name;
Two aliases (e, m) make one table act as two roles; the ON links the subordinate row to its manager row via the recursive FK manager_id → emp_id.