Recall & Review
beginner
What does a CROSS JOIN do in SQL?
A CROSS JOIN returns the Cartesian product of two tables, combining every row from the first table with every row from the second table.
Click to reveal answer
beginner
How many rows will the result have when you CROSS JOIN a table with 3 rows and another with 4 rows?
The result will have 3 × 4 = 12 rows, because each row from the first table pairs with every row from the second table.
Click to reveal answer
beginner
True or False: A CROSS JOIN requires a join condition (ON clause).
False. A CROSS JOIN does not use a join condition; it simply pairs all rows from both tables.
Click to reveal answer
intermediate
What is a real-life example of using a CROSS JOIN?
Imagine you want to create all possible combinations of T-shirt colors and sizes. Using CROSS JOIN on a colors table and a sizes table gives every color paired with every size.
Click to reveal answer
intermediate
How can you limit the size of a CROSS JOIN result?
You can add a WHERE clause to filter rows after the CROSS JOIN or use LIMIT to restrict the number of rows returned.
Click to reveal answer
What does a CROSS JOIN return?
✗ Incorrect
A CROSS JOIN returns the Cartesian product, meaning every row from the first table combined with every row from the second table.
If table A has 5 rows and table B has 2 rows, how many rows will a CROSS JOIN produce?
✗ Incorrect
The result has 5 × 2 = 10 rows, pairing each row of A with each row of B.
Which SQL clause is NOT needed in a CROSS JOIN?
✗ Incorrect
CROSS JOIN does not require an ON clause because it does not use join conditions.
What is a potential risk of using CROSS JOIN without filtering?
✗ Incorrect
Because CROSS JOIN produces all combinations, it can create very large result sets if tables are big.
How can you reduce the number of rows returned by a CROSS JOIN?
✗ Incorrect
Filtering with WHERE after CROSS JOIN helps limit the rows returned.
Explain in your own words what a CROSS JOIN does and when you might use it.
Think about pairing every item from one list with every item from another.
You got /4 concepts.
Describe the risks of using CROSS JOIN on large tables and how to manage those risks.
Consider what happens when you multiply big numbers of rows.
You got /4 concepts.