DBMS - Unit 3 - Notes (Relational Algebra)
DBMS - Unit 3 - Notes (Relational Algebra)
DBMS - Unit 3 - Notes (Relational Algebra)
15
INTERSECTION
• INTERSECTION is denoted by
r x s:
JOIN
The JOIN operation is denoted by the R|X|S symbol
and is used to compound similar tuples from two
Relations into single longer tuples.
Join operation is generally the cross product of two
relation.
The notation used is
Equi Join
Condition Join
Natural Join
Outer Join
EQUI JOIN
For whatever JOIN type (INNER, OUTER, etc), if
we use ONLY the equality operator (=), then we say
that the JOIN is an EQUI JOIN
EQUI JOIN Example
Condition Join
This is same as EQUI JOIN but it allows all other
R c S c (R S)
operators like >, <, >= etc.
Q1. Find the names of sailors who have reserved boat 103
Q2: Find the names of sailors who have reserved a red boat.
Sol1: sname(( color ' red ' Boats) Reserves Sailors)
Sol2: sname( sid(( bid color ' red ' Boats) Res) Sailors)
Examples
Sailors Reserves Boats
sid snam e ratin age
color((sname'Lubber'Sailors) ReservesBoats)
Examples
Sailors Reserves Boats
sid snam e ratin age
Q5. Fine the names of sailors who reserved a red or a green boat.
(Tempboats, ( color ' red ' color ' green ' Boats))