CROSS JOIN pairs every row of one table with every row of another — a Cartesian product. Usually it's an accident that explodes your row count, but in data-science workflows it has genuinely useful applications.
Key Points
- Syntax: SELECT * FROM sizes CROSS JOIN colors; (no ON clause)
- Row count = rows(A) × rows(B) — grows explosively
- Useful for generating all combinations: products × months, sizes × colours
- Builds date scaffolds so time-series reports show zero-activity days
- Forgetting a JOIN condition creates an accidental cross join — a classic bug
- Keep inputs small; cross joining two million-row tables is catastrophic
.png)