~/ learn/ comp-378/ cards/ Joins II: OUTER (LEFT/RIGHT/FULL), SELF JOIN & CROSS JOIN
1 of 6

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.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/f60c9a7a-44f6-425b-954d-bd2a4d92737f/flashcard utf-8 LF