Question: 23.18 Again using the Hotel schema, draw a relational algebra tree for each of the following queries and use the heuristic rules given in Section
23.18 Again using the Hotel schema, draw a relational algebra tree for each of the following queries and use the heuristic rules given in Section 23.3.2 to transform the queries into a more efficient form. Discuss each step and state any transformation rules used in the process.
(a)
SELECT r.roomNo, r.type, r.price
FROM Room r, Booking b, Hotel h
WHERE r.roomNo = b.roomNo AND b.hotelNo = h.hotelNo AND
h.hotelName = Grosvenor Hotel AND r.price > 100;
(b)
SELECT g.guestNo, g.guestName
FROM Room r, Hotel h, Booking b, Guest g
WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND
h.hotelName = Grosvenor Hotel AND dateFrom >= 1-Jan-08 ANDdateTo <= 31-Dec-08;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
