Cross joins are one of the more straightforward join types in SQL, but they’re also one of the most misunderstood and potentially dangerous if used carelessly. Understanding when and how to use them properly can help you solve certain data problems efficiently while avoiding performance disasters.
A cross join returns the Cartesian product of two tables. This means that it combines every row from the first table with every row from the second table. If you have 10 rows in one table and 5 rows in another, you might immediately assume that it will return 15 rows. But you’d be wrong. A cross join will return 50 rows. No join condition in the ON clause. Just every possible combination of rows.