Joins · SQL SQL

Consider two tables: A with 5 rows and B with 4 rows. If you perform a CROSS JOIN between A and B without any WHERE clause, how many rows will the re…

Practice question from Joins (SQL SQL), with the correct answer and a step-by-step solution.

easy · MCQ · Q-98D4D4

Consider two tables: A with 5 rows and B with 4 rows. If you perform a CROSS JOIN between A and B without any WHERE clause, how many rows will the resulting dataset contain?

  1. A.1
  2. B.9
  3. C.20Correct answer
  4. D.Depends on matching columns

Solution

A CROSS JOIN produces the Cartesian product of the two tables. The number of rows in the result is the product of the number of rows in each table (5×4=205 \times 4 = 20).

More from Joins

All of Joins

Practise more SQL

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed