A CROSS JOIN creates every possible combination of rows.
If:
- Table A = 100 rows
- Table B = 50 rows
Result:
100 × 50 = 5,000 rows
Example:
SELECT * FROM products CROSS JOIN colors;
If there are 100 products and 5 colors, you get 500 combinations.
Use cases:
- Generating combinations
- Calendar/date combinations
- Test data
- Product/option combinations
Watch out: CROSS JOIN can explode into a huge result.