Consider two relations R1 (A, B) with the tuples (1, 5), (3, 7) and R2 (A, C)…
Consider two relations R1 (A, B) with the tuples (1, 5), (3, 7) and R2 (A, C) = (1, 7), (4, 9).
Assume that R (A, B, C) is the full natural outer join of R1 and R2. Which one of the following
tuple of the form (A, B, C) is not containing by R?
Answer: A. (4, 7, null) — Approach: compute the full natural outer join on attribute A: include combined tuples for matching A values and include unmatched tuples from each relation…
- A.
(4, 7, null)
- B.
(1, 5, 7)
- C.
(3, 7, null)
- D.
(4, null, 9)
Attempted by 39 students.
Show answer & explanation
Correct answer: A
Approach: compute the full natural outer join on attribute A: include combined tuples for matching A values and include unmatched tuples from each relation with nulls for missing attributes.
A = 1 appears in both relations, combining B = 5 and C = 7 to give (1, 5, 7).
A = 3 appears only in the first relation, so include (3, 7, null) with C set to null.
A = 4 appears only in the second relation, so include (4, null, 9) with B set to null.
Conclusion: the full natural outer join contains (1, 5, 7), (3, 7, null), and (4, null, 9). The tuple (4, 7, null) is not present because for A = 4 the only C value is 9 and there is no B = 7 for A = 4; B should be null.
A video solution is available for this question — log in and enroll to watch it.