Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q32 — Normal Forms

Explain with AI

Consider two relations R1(A,B)R_1(A,B) with the tuples (1,5),(3,7)(1,5), (3,7) and R2(A,C)=(1,7),(4,9)R_2(A,C) = (1,7),(4,9).

Assume that R(A,B,C)R(A,B,C) is the full natural outer join of R1R_1 and R2R_2. Consider the following tuples of the form (A,B,C):(A,B,C):

a=(1,5,null),b=(1,null,7),c=(3,null,9),d=(4,7,null),e=(1,5,7),a = (1,5,null), b=(1,null,7), c=(3,null,9), d=(4,7,null), e=(1,5,7),

f=(3,7,null),g=(4,null,9).f=(3,7,null), g=(4,null,9).

Which one of the following statements is correct?

Choose one option
View worked solution

Answer: C

A full natural outer join (R1⋈outerR2R_1 \bowtie_{outer} R_2) combines the matching tuples of both relations based on their common attributes, and also preserves the unmatched tuples from both relations by padding the missing attributes with null.

Given relations:

  • R1(A,B)={(1,5),(3,7)}R_1(A, B) = \{(1, 5), (3, 7)\}
  • R2(A,C)={(1,7),(4,9)}R_2(A, C) = \{(1, 7), (4, 9)\}

The common attribute is AA. Let's compute the join step-by-step:

  1. Matching Tuples (Inner Join):
    • For A=1A = 1, we have (1,5)(1, 5) in R1R_1 and (1,7)(1, 7) in R2R_2. Joining them yields: (1,5,7)(which is tuple e)(1, 5, 7) \quad \text{(which is tuple } e\text{)}
  2. Unmatched Tuples from R1R_1 (Left Outer Join component):
    • For A=3A = 3, the tuple (3,7)(3, 7) in R1R_1 has no matching tuple in R2R_2. We pad the attribute CC with null: (3,7,null)(which is tuple f)(3, 7, \text{null}) \quad \text{(which is tuple } f\text{)}
  3. Unmatched Tuples from R2R_2 (Right Outer Join component):
    • For A=4A = 4, the tuple (4,9)(4, 9) in R2R_2 has no matching tuple in R1R_1. We pad the attribute BB with null: (4,null,9)(which is tuple g)(4, \text{null}, 9) \quad \text{(which is tuple } g\text{)}

Thus, the full natural outer join relation R(A,B,C)R(A, B, C) contains exactly the tuples: R={e,f,g}R = \{e, f, g\}

Therefore, RR contains e,f,ge, f, g but does not contain a,b,c,da, b, c, d. This matches Option C.

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

Published
Report a correction
Keep exploringMore Normal Forms questions