Again, using the Hotel schema, draw a relational algebra tree for each of the following queries and

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 to transform the queries into a more efficient form:
(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’;
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: