Practice free →
HomeGATE CSEcomputerscienceDatabase Management Systems › If `student` has 50 rows and `course` has 8 rows…

If `student` has 50 rows and `course` has 8 rows, `SELECT * FROM student CROSS JOIN course` returns

A58 rows (sum)
B50 rows (the larger table)
C8 rows (the smaller table)
D400 rows; every pair (s, c)
Answer & Solution
Correct answer: D. 400 rows; every pair (s, c)
CROSS JOIN produces the Cartesian product: every row on the left paired with every row on the right. 50 x 8 = 400. There is no matching condition; the result blows up multiplicatively. This is why CROSS JOIN is almost always used inside a WHERE filter that turns it back into an INNER JOIN.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions