Database Systems the Complete Book 2nd Edition Exercise 162
###
Database Systems the Complete Book (2nd Edition)
Exercise 16.2.1:
Give examples to show that:
a)Projection cannot be pushed below set union.
b)Projection cannot be pushed below set or bag difference.
c)Duplicate elimination () cannot be pushed below projection.
d)Duplicate elimination cannot be pushed below bag union or difference.
For more clarifications observe this link.
https://www.chegg.com/homework-help/Database-Systems-The-Complete-Book-2nd-edition-chapter-16.2-problem-2E-solution-9780131873254
Solution
a)
A(a,b) = {(3,4)}
B(a,b) = {(3,5)}
a (A B) = {(3),(3)}
aA aB = {(3)}
b)
For Sets: A(a,b) = {(3,4)}
B(a,b) = {(3,5)}
a(A-B) = {(3)}
(Aa Ba) =
For Bags: A(a,b) = {(3,4),(3,4),(3,4)}
B(a,b) = {(3,4), (3,5)}
a(A-B) = {(3),(3)}
(Aa Ba) = {(3)}
c)
A(a,b) = {(3,4),(3,5)}
a((A)) = {(3),(3)}
((Aa)) = {(3)}
d)
A(a,b) = {(3,4),(3,4),(3,4)}
B(a,b) = {(3,4), (3,5)}
(A B) = {(3,4),(3,4),(3,4),(3,4), (3,5)}
(A) (B) = {(3,4),(3,4), (3,5)}

