Chapter Five
Chapter Five
Relational Algebra
Name Salary
John 20000
John 60000
Set Operation (Union, Intersection, Set-
Difference)
All of these operations take two input relations, which must be union-compatible:
Same number of fields.
Corresponding’ fields have the same type.
S1 S2
C⋈D
Num Square Cube
2 4 8
3 9 27
A
Num Square
2 4
3 9
4 16 A⋈B
A⋈B
Num Cube Square
2 8 4
3 18 9
5 75 –
A⋈B
2 4 8
3 9 18
4 16 –
5 – 75
In the left outer join, operation allows keeping all tuple in the
Left Outer Join( )
left relation.
Right Outer In the right outer join, operation allows keeping all tuple in the
join( ) right relation.
Full Outer In a full outer join, all tuples from both relations are included in
Join( ) the result irrespective of the matching condition.