Exercises 1
( Relational Algebra )
Questions
Consider the following collection of relation schemes:
professor(profname, deptname)
department(deptname, building)
committee(profname,commname)
- (2 points) Find all the professors who are in any one of the committees
that Professor Smith is in.
- (3 points) Find all the professors who are in at least all those
committees that Professor Smith is in.
- (4 points) Find all the professors who are in exactly (i.e., no more and
no less) all those committees that Professor Smith is in.
- (3 points) Find all the professors who have offices in at least all those
buildings that Professor Smith has offices in.
Answers
-
R2 <-
commname(
profname =
Smith(committee))
profname(committee
R2)
-
R2 <-
commname(
profname =
Smith(committee))
committee / R2
-
R2 <-
commname(
profname =
Smith(committee))
R3 <-
commname(committee) - R2
(committee / R2) -
profname(committee
R3)
-
R4 <-
profname, building(professor
department)
R5 <-
profname = Smith(professor)
department
R4 /
building(R5)