Reference no: EM1316946
By utilizign the Hotel database schema:
Hotel (hotelNo, name, address)
Room (roomNo, hotelNo, type, price)
Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)
Where,
a) Hotel contains hotel details and hotelNo is the Primary Key (PK).
b) Room consists of room details for each hotel and hotelNo, roomNo, forms the PK.
c) Booking consists of details of the bookings and guestNo, HotelNo and dateFrom forms the PK.
Based upon the schema, a query for choosing the room number, room type and room price for
EDC Hotel and the room price must RM150 and above are described:
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 = ‘EDC Hotel’ AND r.price > 150;
1) Sketch a relational algebra tree (RAT) for each of queries and use the heuristic rules to convert the queries into a more efficient form. Describe each step and state any transformation rules utilized in the process.