Practice free →
HomeGATE CSEcomputerscienceDatabase Management Systems › If 100 students exist and 30 are enrolled in cou…

If 100 students exist and 30 are enrolled in courses (with no other quirks), then `SELECT s.name FROM student s LEFT JOIN enroll e ON s.roll = e.roll` returns

A30 rows; only enrolled students
B0 rows; LEFT JOIN requires matches
C100+ rows; every student row is preserved
Dexactly 130 rows; the join sums the cardinalities
Answer & Solution
Correct answer: C. 100+ rows; every student row is preserved
LEFT JOIN preserves every row from the left table. Each of the 100 students appears at least once in the output; students with multiple enrollments may appear multiple times (one per enrollment). For students with no enrollment, the right-side columns are NULL.
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions