Home › GATE CSE › computerscience › Database 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.
Related questions
The main reasons production DBMSs avoid shadow paging in favour of WAL are that shadow pagWhat is the purpose of a Compensation Log Record (CLR) in ARIES?ARIES recovery is structured as exactlyFuzzy checkpoints differ from naive checkpoints byIn standard log-based recovery, the order of operations isAfter a crash, with checkpointing, the recovery system scans the logA complete log record for a write operation includesPer WAL semantics, a transaction is officially committed at the moment