How do we query hierarchical relationships within the same table?
A SELF JOIN joins a table to itself using distinct aliases to represent parent/child or manager/employee roles.
Organizational hierarchy, category breadcrumbs, graph node-to-parent relationships.
SELECT e.name AS employee,
m.name AS manager
FROM employees e
LEFT JOIN employees m
ON e.manager_id = m.id;Practice typing production-grade SQL code for SQL SELF JOIN.