GATE / CS ARCHIVE

GATE CSE 2004 / QUESTION 14

Natural-join cardinality and an unstated foreign key

Database Management Systems · Relational Algebra & Calculus · Full GATE CSE 2004 paper

GATE 2004, Q14 1 mark · MCQ
Report issue

Relational Algebra & Calculus

Question 14, GATE 2004: Student(rollno,name,address) has key rollno; Enroll(rollno,courseno,coursename) has composite key (rollno,courseno). They have 120 and 8 tuples respectively. What are the maximum and minimum sizes of Student ⋈ Enroll (natural join)? No foreign-key constraint is stated.
Options:
(A) 8,8
(B) 120,8
(C) 960,8
(D) 960,120
Tap to enlarge
Your answer
Answer & solution

Answer: Maximum8, minimum 0; A only with referential integrity (no official key was published)

1. Student.rollno is the underlined key, while Enroll has the composite key(rollno,courseno). Each of the 8 enrollment tuples can match at most one Student tuple, so the maximum join size is 8.

2. With only the stated keys, all enrollment roll numbers may be absent from Student, giving minimum 0; no listed pair is then correct. If the intended additional constraint is Enroll.rollno referencing Student.rollno, every enrollment matches exactly once and both maximum/minimum are 8, A.

3. This foreign-key constraint is not stated and is not inferred from matching attribute names alone.

4. Teaching check: The maximum is attained when all eight enrollments use existing student roll numbers, possibly different courses for the same student. The minimum zero is attained by eight enrollments with roll numbers absent from Student. Primary-key uniqueness alone rules out duplicate student matches, not missing matches.

Original paper, page 2