Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Publishing With Filemaker Pro On The Web

Authors: Maria Langer

1st Edition

0201696657, 978-0201696653

More Books

Students also viewed these Databases questions

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago