GATE / CS ARCHIVE

GATE CSE 2010 / QUESTION 43

Maximum natural-join cardinality

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

GATE 2010, Q43 2 marks · MCQ
Report issue

Relational Algebra & Calculus

Question 43, GATE 2010: Relations R(A,B,C) and S(B,D,E) obey B→A and A→C in R. R contains 200 tuples and S contains 100 tuples. What is the maximum possible cardinality of their natural join R⋈S?
Options: (A) 100; (B) 200; (C) 300; (D) 2000.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Within R(A,B,C), B→A and A→C imply B→ABC, so B is a key under relational set semantics. In the natural join on common attribute B, each of the 100 tuples of S(B,D,E) matches at most one R tuple. Therefore the join has at most 100 tuples. This bound is attainable by choosing all S.B values among the 200 R.B values, so A. The cardinality of R does not multiply each S row because B is unique in R.

The bound is attained, for example, by choosing 100 S rows whose B values all occur in R, with distinct D,E as needed. Every S row then contributes exactly one join row. Different S rows may share a B value without violating any stated dependency, but none can match two R rows because B determines every attribute of R. This is a many-to-one join from S to R.

Original paper, page 10