Question: 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
(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-04’ AND dateTo <= ‘31-Dec-04’;
Step by Step Solution
3.43 Rating (166 Votes )
There are 3 Steps involved in it
a b Discuss each step and state any transformation ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
672-CS-DB (1440).docx
120 KBs Word File
