Self and Cross Joins

Published July 26, 2025 By Sai Sree Ram Gundepudi

Self and Cross Joins

Self Join

A self join is when a table is joined to itself.

SELECT e1.first_name, e2.first_name AS manager
FROM employees e1
JOIN employees e2 ON e1.manager_id = e2.employee_id;

Cross Join

Cross join returns the Cartesian product of both tables.

SELECT e.first_name, d.department_name
FROM employees e
CROSS JOIN departments d;

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article