Question
Consider the following relational database schema (primary keys are bolded) and SQL queries: Hotel ( hotelNo , hotelName, city) Room ( roomNo, hotelNo , type,
Consider the following relational database schema (primary keys are bolded) and SQL queries:
Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress)
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 = "Ritz" AND r.price > 100;
(A) state what information they retrieve (B) give a corresponding Relational Algebra expression (C) draw the initial canonical query tree (D) use heuristic optimization to transform it into the most efficient query tree possible. (E) Compare the cost of at least two different query plans for the given queries. You can make appropriate assumptions for the database statistics (F) Suggest what appropriate indexes should be built upon the given relations to improve the query performance. Justify your answer
Show all intermediate steps and transformations in detail. You can make appropriate assumptions for the database statistics to support your claim.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started