








































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









































































Queries:
8 ( 2 ) sid sname rating age
28 yuppy 9 35. 58 rusty 10 35. sname rating yuppy 9 rusty 10 π σ sname rating (^) rating S , ( ( ))
8 2
Union, Intersection, Set-Difference
,.., , ,.. S R sid agebid sid π
sno pno s1 p s1 p s1 p s1 p s2 p s2 p s3 p s4 p s4 p pno p pno p p pno p p p sno s s s s sno s s sno s A B B B A/B1 A/B2 A/B
Expressing A/B Using Basic Operators
sid (Sales) - A
EQUALITY JOIN, NATURAL JOIN, JOIN, SEMI-JOIN
EXAMPLE JOIN
dno dname floor mgrss# 1 Toy 1 5 2 Shoe 2 1
(dno) SS# Name Age Salary dno dname floor mgrss# 1 Joe 24 20000 2 Shoe 2 1 2 Mary 20 25000 1 Toy 1 5 3 Bob 22 27000 1 Toy 1 5 4 Kathy 30 30000 2 Shoe 2 1 5 Shideh 4 4000 1 Toy 1 5
EXAMPLE JOIN
Salary > 5 * salary SS# Name Age Salary dno x.SS# x.Name x.Age x.Salary x.dno 2 Mary 20 25000 1 2 Shideh 4 4000 1 3 Bob 22 27000 1 3 Shideh 4 4000 1 4 Kathy 30 30000 2 4 Shideh 4 4000 1