Skip to content
Official PYQ · 2004

GATE CS 2004 Q14 — Relational Model: Relational Algebra

Explain with AI

Consider the following relation schema pertaining to a students database:

  • Students (rollno, name, address)
  • Enroll (rollno, courseno, coursename)

where the primary keys are shown underlined. The number of tuples in the student and Enroll tables are 120120 and 88 respectively. What are the maximum and minimum number of tuples that can be present in (Student * Enroll), where ‘*’ denotes natural join?

Choose one option
View worked solution

Answer: A

To find the maximum and minimum number of tuples in the natural join Students⋈Enroll\text{Students} \bowtie \text{Enroll}, let us analyze the schema and constraints:

  1. Common Attribute: The natural join is performed on the common attribute, which is rollno.
  2. Primary Key Constraint:
    • In the Students table, rollno is the primary key. This means every rollno in Students is unique.
    • In the Enroll table, (rollno, courseno) is the primary key. Thus, rollno can repeat in Enroll, but each tuple represents a valid enrollment.
  3. Referential Integrity: In a standard database schema, Enroll.rollno acts as a foreign key referencing Students.rollno. This means every student enrolled in a course must exist in the Students table.

Using these constraints, we can determine the size of the join:

  • Since rollno is unique in Students, any rollno present in Enroll will match with exactly one tuple in Students.
  • Since there are 88 tuples in Enroll, and each of these 88 tuples matches exactly one tuple in Students, the natural join will yield exactly 88 tuples.

Therefore, both the maximum and minimum number of tuples in the natural join is 88.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Relational Model: Relational Algebra questions