CROSS JOIN and Self Join

CROSS JOIN returns the Cartesian product — all combinations of rows from both tables.

SELECT *
FROM products
CROSS JOIN categories;

Self Join is a regular join where a table is joined with itself.

SELECT A.name, B.name
FROM employees A, employees B
WHERE A.manager_id = B.id;
← PrevNext →