Again using the Hotel schema, drawing 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. 1. 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; 2. 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 dataFrom >= ‘1-Jan-08’ AND dateTo <= ’31-Dec-08’;
Again using the Hotel schema, drawing 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.
1.
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;
2.
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 dataFrom >= ‘1-Jan-08’ AND dateTo <= ’31-Dec-08’;
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images