patternMinor
What is OUTER UNION and why is it partially compatible
Viewed 0 times
whywhatunioncompatiblepartiallyandouter
Problem
I am trying to understand how a
I am aware this operation was created to take union of tuples from two relations if the relation are not type compatible (which I understand).
Examples of this operation will be great!
OUTER UNION $∪^✳$ works, and why it is only partially compatible. I am aware this operation was created to take union of tuples from two relations if the relation are not type compatible (which I understand).
Examples of this operation will be great!
Solution
There are two flavors of outer union: with and without
$ X \bigcup Y = \overline {\overline X \Join \overline Y} $
Date&Darwen call this operation $\blacktriangleleft OR \blacktriangleright$.
Given
and
both outer join variants agree that the result projected to common column
with all the values from corresponding domain, while the
NULLs. Google search readily exibits an example for NULLs version. The cleaner version of relational algebra desn't allow NULLs, and outer union is defined via De Morgan's law:$ X \bigcup Y = \overline {\overline X \Join \overline Y} $
Date&Darwen call this operation $\blacktriangleleft OR \blacktriangleright$.
Given
R = [A B]
1 2
3 4and
S = [B C]
4 5
6 7both outer join variants agree that the result projected to common column
B should be {2,4,6}. This is what is called inner union -- alternative way of generalizing standard relational algebra union operator. Now the problem is finding values of attributes A and C. Next, we match the values of the "middle column" with attributes A and C trying to leverage information in the relations R and S. In case of value B=2 we don't have matching value of C. Likewise, for B=6 we don't have matching value of A. Therefore, D&D $\blacktriangleleft OR \blacktriangleright$ operator fills the blanks in[A B C]
1 2
3 4 5
6 7with all the values from corresponding domain, while the
NULL version just blurts NULLs.Code Snippets
R = [A B]
1 2
3 4S = [B C]
4 5
6 7[A B C]
1 2
3 4 5
6 7Context
StackExchange Computer Science Q#6997, answer score: 2
Revisions (0)
No revisions yet.