Examine the BRICKS table:
You write this query:
How many rows will the query return?
Examine the BRICKS table:
You write this query:
How many rows will the query return?
The CROSS JOIN operation combines each row from the BRICKS table with every other row, generating 4 * 4 = 16 combinations. The WHERE clause filters out rows where the weight of the first brick (b1) is not less than the weight of the second brick (b2). Specifically, the query returns rows where b1's weight is less than b2's weight. The valid combinations are: (5, 10), (5, 15), (5, 20), (10, 15), (10, 20), and (15, 20). Thus, the query returns 6 rows.
The correct answer is B which is 6 rows Explanation: The CROSS JOIN operation combines each row from the first table with each row from the second table. Since the BRICKS table has 4 rows, the result of the CROSS JOIN will have 4 * 4 = 16 rows. The WHERE clause filters out rows where b1.weight is not less than b2.weight. This means that only rows where the weight of the first brick is less than the weight of the second brick will be included in the result. There are 6 such combinations: (5,10), (5,15), (5,20), (10,15), (10,20), and (15,20). So the final result will have 6 rows.
Option B is correct
checked in DB B is correct
Option B is correct
return 6 rows option B tested
C is correct
I think its 16
4*4=16
forget what i said above, correct answer is 6