考虑元组(1,5),(3,7)和R1(A,C)=(1,7),(4,9)的两个关系R1(A,B)。假定R(A,B,C)是R1和R2的完全自然外部连接。考虑以下形式为(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).
下列哪种说法是正确的?
(A) R包含a,b,e,f,g,但不包含c,d
(B) R包含a,b,c,d,e,f,g
(C) R包含e,f,g但不包含a,b
(D) R包含e但不包含f,g答案: (C)
解释:
Below is R1
A | B
-----------
1 | 5
3 | 7
Below is R2
A | C
-----------
1 | 7
4 | 9
Full outer join of above two is
A | B | C
-------------------
1 | 5 | 7
3 | 7 | NULL
4 | NULL | 9
因此完整的外部联接包含e =(1、5、7),f =(3、7,null),g =(4,null,9)。这个问题的测验