How can I generate a table Comp{(y,z)} that is a composition of two other separate tables RelOne{(x,y)} and RelTwo{(y,z)}. The rows in each table represent ordered pairs of a many-to-many relationship.
RelOne is
(a, 1)
(b, 1)
(c, 1)
(a, 2)
(b, 2)
RelTwo is
(1, East)
(1, West)
(2, East)
(2, South)
(2, West)
(2, North)
There are no natural keys for either table.
The composition of RelOne and RelTwo would be
CompositionOneTwo is
(a, East)
(b, East)
(c, East)
(a, West)
(b, West)
(c, West)
(a, East)
(a, South)
(a, West)
(a, North)
(b, East)
(b, South)
(b, West)
(b, North)
I have five such situations, the actual tables have many hundreds of rows.
Thanks for any pointers.
RelOne is
(a, 1)
(b, 1)
(c, 1)
(a, 2)
(b, 2)
RelTwo is
(1, East)
(1, West)
(2, East)
(2, South)
(2, West)
(2, North)
There are no natural keys for either table.
The composition of RelOne and RelTwo would be
CompositionOneTwo is
(a, East)
(b, East)
(c, East)
(a, West)
(b, West)
(c, West)
(a, East)
(a, South)
(a, West)
(a, North)
(b, East)
(b, South)
(b, West)
(b, North)
I have five such situations, the actual tables have many hundreds of rows.
Thanks for any pointers.