Suppose we have three relations r(A,B), s(B,C), and t(B,D), with all attributes declared
as not null.
a. Give instances of relations r,s, and t such that in the result of
(r NATURAL LEFT OUTER JOIN s) NATURAL LEFT OUTER JOIN t
attribute C has a null value but attribute D has a non-null value.
b. Are there instances of r, s, and t such that the result of
r NATURAL LEFT OUTER JOIN (s NATURAL LEFT OUTER JOIN t)
has a null value for C but a non-null value for D? Explain why or why not.
a. Consider r=(a,b), s=(b1,c1), t=(b,d). The second expression would give
(a,b,null,d).
b. Since s natural left outer join t is computed first, the absence of nulls in both
s and t implies that each tuple of the result can have D null, but C can never be null.
Note: This imples that the the operation natural left outer join is NOT associative.