1. Consider the Bicycle Rental database below. For each of the following relatio
ID: 3602610 • Letter: 1
Question
1. Consider the Bicycle Rental database below. For each of the following relational algebra expressions, (1) describe the data request in English (for example, "all Rentals before January 5, 2017" and (2) give the result (relation instance) a. BikeID (PreviousRental)- Bikelp (Rental) b. BikeID (Rental)- Bike12 (PreviousRental) c. accountip, Bike1D(Rental) n account!R. Bike!R (Previou s Rental) Bicycle Rental Database Rental accountlD BikelD ateRented perHou 113 12/22/2016$8.00 1141/2/2017 $8.00 145 1/4/2017 $12.00 101 909871/1/2017 $4.99 101 997871/1/2017 $5.00 101 1/3/2017 $8.00 123 12/1/2016 $12.00 101 101 101 103 103 PreviousRental accountlDBikelD dateRented perHour 101 12/9/2016$8.00 112 1/13/2016$7.50 113 5/15/2016$7.50 113 12/1/2016$8.00 101 2/4/2016$7.50 111 997877/1/2016$4.50 113 12/9/2016$8.00 20177564 8/14/2016 $4.50 101 101 101 102 201Explanation / Answer
a)
1. Set difference operator is used. It will project all the BikeID that are in 'PreviousRental' table but not in 'Rental' table.
2. Output (Relation Instance)-
BikeID
112
77564
b)
1. Again set difference operator is used but vice versa. It will project all the BikeID that are in 'Rental'; table but not in 'PreviousRental' table.
2. Output-
BikeID
114
145
123
c)
1. Set intersection operator is used. It will project all the combination of accountID and BikeID which are there in both the ‘PreviousRental’ table and ‘Rental’ table.
2. Output-
AccountID
BikeID
101
113
BikeID
112
77564
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.