Management & CommerceModerateBusiness analyst · SQL test

Table orders has 3 rows and table items has 6 rows. How many rows does SELECT * FROM orders CROSS JOIN items return?

  1. A. 9 rows
  2. B. 6 rows
  3. C. 18 rows
  4. D. 3 rows

Correct answer: C. 18 rows

A cross join has no join condition: it pairs every row of one table with every row of the other, 3 × 6 = 18. Adding the counts (9) or taking the larger table's size (6, as if each item matched one order) confuses it with a matching inner join.

More Operations, Supply Chain & Business Analytics questions

Exams that ask this topic