Beruflich Dokumente
Kultur Dokumente
Relational Algebra
Restrict
Project
Product
Union
Intersect
Difference
Join
Divide
Restrict
Examples:
Select the EMPLOYEE tuples whose department number is 4:
DNO = 4 (EMPLOYEE)
Slide 6- 5
Slide 6- 6
Slide 6- 7
Slide 6- 8
Project
Slide 6- 10
Slide 6- 11
Slide 6- 12
Union
UNION Operation
Slide 6- 14
Example:
Slide 6- 15
UNION Example
Slide 6- 16
Intersect
INTERSECTION is denoted by
The result of the operation R S, is a
relation that includes all tuples that are in
both R and S
Slide 6- 18
Difference
Slide 6- 20
Slide 6- 21
R S = S R, and R S = S R
R (S T) = (R S) T
(R S) T = R (S T)
RSSR
Copyright 2007 Ramez Elmasri and Shamkant B. Navathe
Slide 6- 22
Product
a
b
c
Product
a
a
x
b
y
b
c
c
x
y
x
y
x
y
Slide 6- 24
Join
A1 B1
A2 B1
A3 B2
B1 C1
B2 C2
B3 C3
(Natural
or Inner)
Join
A1 B1 C1
A2 B1 C1
A3 B2 C2
Slide 6- 26
MGRSSN=SSN
EMPLOYEE
Slide 6- 27
Slide 6- 28
Slide 6- 29
Slide 6- 30
EQUIJOIN Operation
The most common use of join involves join
conditions with equality comparisons only
Such a join, where the only comparison operator
used is =, is called an EQUIJOIN.
Slide 6- 31
Slide 6- 32
Q(A,B,C,D,E)
Slide 6- 33
Slide 6- 34
Slide 6- 35
Divide
a
a
a
b
c
x
y
z
x
y
Divide
x
y
DIVISION Operation
Slide 6- 37
Example of DIVISION
Slide 6- 38
Slide 6- 39