4.4
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 ofNATURAL LEFT OUTER JOIN s) NATURAL LEFT OUTER JOIN t (r
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 ofNATURAL LEFT OUTER JOIN (s NATURAL LEFT OUTER JOIN t) r
has a null value for \(C\) but a non-null value for \(D\)? Explain why or why not.
Consider \(r = (a,b)\), \(s = (b1,c1)\), \(t = (b,d)\). The second expression would give \((a,b,null,d)\).
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.