Practice mode DBMS and SQL

Table Colour(c) has rows ‘red’, ‘blue’. Table Size(s) has rows ‘S’, ‘M’, ‘L’. SELECT COUNT(*) FROM Colour CROSS JOIN Size; What is the result?

Correct answer C. 6

Explanation

A CROSS JOIN is the Cartesian product: every row of the first table is paired with every row of the second, so the row count is 2 x 3 = 6. There is no join condition to filter pairs. The answer 5 adds the counts instead of multiplying them, which would describe UNION ALL of two single-column results, not a join.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.