Consider two relations R₁(A,B) with the tuples (1,5), (3,7) and R₂(A,C) =…

2021

Consider two relations R₁(A,B) with the tuples (1,5), (3,7) and
R₂(A,C) = (1,7), (4,9). Assume that R(A,B,C) is the full natural outer join of R₁ and R₂. Consider the following tuples of the form (A,B,C):

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).

Which one of the following statements is correct?

  1. A.

    R contains a, b, e, f, g but not c, d

  2. B.

    R contains all of a, b, c, d, e, f, g

  3. C.

    R contains e, f, g but not a, b

  4. D.

    R contains e but not f, g

  5. E.

    Question not attempted

Attempted by 747 students.

Show answer & explanation

Correct answer: C

To determine which tuples are in the full natural outer join of R₁ and R₂, we first understand the join operation. R₁(A,B) has tuples: (1,5), (3,7) R₂(A,C) has tuples: (1,7), (4,9) Full natural outer join includes all tuples from both relations. For matching A values, combine B and C. For unmatched tuples, fill missing attributes with null. Matching A=1: (1,5) from R₁ and (1,7) from R₂ → (1,5,7) R₁ has A=3, not in R₂ → (3,7,null) R₂ has A=4, not in R₁ → (4,null,9) Thus, the result contains: (1,5,7), (3,7,null), (4,null,9) Now evaluate the given tuples: a = (1,5,null): Incorrect, C should be 7 if A=1 matches. b = (1,null,7): Incorrect, B should be 5 if A=1 matches. c = (3,null,9): Incorrect, C should be null, not 9. d = (4,7,null): Incorrect, B should be null, not 7. e = (1,5,7): Correct, matches the join result. f = (3,7,null): Correct, from R₁ with no match in R₂. g = (4,null,9): Correct, from R₂ with no match in R₁. Therefore, R contains e, f, g.

Explore the full course: Up Lt Grade Assistant Teacher 2025