Produce the Cartesian product of two tables.

Section: Join types at a glance

CROSS JOIN

sql
sql
SELECT s.size, c.color
FROM sizes s
CROSS JOIN colors c;
Explanation

Use carefully. Output size becomes `left_rows × right_rows`.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Join types at a glance
INNER JOIN
Return only rows that match on both sides.
OpenIn sheetsqlsame section
LEFT JOIN
Keep all rows from the left table and match rows from the right when available.
OpenIn sheetsqlsame section
RIGHT JOIN
Keep all rows from the right table and match rows from the left when available.
OpenIn sheetsqlsame section
FULL OUTER JOIN
Keep all rows from both tables and match where possible.
OpenIn sheetsqlsame section
Join on stable keys
Prefer primary keys and foreign keys over names or free-form text.
Put right-side filters in ON when preserving outer rows
A `WHERE` clause can accidentally turn a left join into an inner join.