Interview Question

What is CROSS JOIN?

CROSS JOIN creates every possible row pair.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

A CROSS JOIN returns the Cartesian product of two inputs. • Every left row is paired with every right row. • The result size is the product of the input row counts. • Use it deliberately for combinations, not as a missing join condition.

💡 SQL Example

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

Result

Every color and size combination

⚡ Quick Revision

CROSS JOIN creates every possible row pair.