Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

By using the Hotel database schema:
Hotel (hotelNo, name, address)
Room (roomNo, hotelNo, type, price)
Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)
Where,
? Hotel contains hotel details and hotelNo is the Primary Key (PK).
? Room contains room details for each hotel and roomNo, hotelNo forms the PK.
? Booking contains details of the bookings and HotelNo, guestNo and dateFrom forms the PK.
Based on the schema, a query for selecting room number, room type and room price for
EDC Hotel and the room price must RM150 and above is defined:
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;
problem 1
Draw a relational algebra tree (RAT) for each of the queries and use the heuristic rules to
transform the queries into a more efficient form. describe each step and state any
transformation rules used in the process. (4 marks)
------------------------------------------------------------------------------------------------------------
problem 2
Assume the following indexes exist in the Hotel database schema:
• A hash index with no overflow on the primary key attributes, roomNo+hotelNo in Room;
• A clustering index on the foreign key attributes hotelNo in Room;
• A B+-tree index on the price attribute in Room;
• A secondary index on the attribute type in Room.
nTuples(Room) = 10000
bFactor(Room) = 200
nTuples(Hotel) = 50
bFactor(Hotel) = 40
nTuples(Booking) = 100000
bFactor(Booking) = 60
nDistincthotelNo(Room) = 50
nDistincttype(Room) = 10
nDistinctprice(Room) = 500
minprice(Room) = 200
maxprice(Room) = 500
nLevelshotelNo(I) = 2
nLevelstype(I) = 2
nLevelsprice(I) = 2
nLfBlocksprice(I) = 50
STID5014/5043 - ADVANCE DATABASE DESIGN
(a) find out the cardinality and minimum cost for each of the following Selection
operations:
i) σroomNo=1 ∧ hotelNo=1(Room) 
ii) σhotelNo='H02'(Room) 
(b) find out the cardinality and minimum cost for each of the following Join operations:
i) Hotel? hotelNo Room 
ii) Hotel? hotelNo Booking 
(c) find out the cardinality and minimum cost for the Projection operations
?hotelNo(Room)   

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M989097

Have any Question?


Related Questions in DBMS

Question 1 what isdata-manipulation language dml there are

Question: 1. What isData-Manipulation Language (DML)? There are four types of access in DML, explain each one. 2. Assume we have a Library Database consists of the following relations: author(author_id, first_name, last_ ...

Question as explained throughout this course entity

Question: As explained throughout this course, entity relationship modeling is a critical element of database design. If the database is not properly modeled, it is unlikely that the database will be properly developed. ...

You are in a real estate business renting apartments to

You are in a real estate business renting apartments to customers. Your job is to define an appropriate schema using SQL DDL in MySQL. The relations are Property(Id, Address, NumberOfUnits), Unit(ApartmentNumber, Propert ...

A taking an unnormalised list describe how you would

(a) Taking an unnormalised list, describe how you would normalise it using the normal forms technique and show how the result of this method is used. (b) You are currently in the process of developing a RDBMS for a natio ...

A schools office of the registrar maintains data about the

A School's office of the registrar maintains data about the following entities: a) courses (including course number, title, credits, syllabus and prerequisites), b) course offerings (including course number, year, semest ...

Database and information retrieval assignment - data

Database and Information Retrieval Assignment - Data Privacy Essay Task - Write an essay (aim for 750 words) that addresses issues associated with data proivacy. Use the Australian Privacy Principles - discussed in class ...

Tableau is business intelligence software that helps people

Tableau is business intelligence software that helps people see and understand their data. Fast Analytics Connect and visualize your data in minutes. Tableau is 10 to 100x faster than existing solutions. Ease of Use Anyo ...

Sqlwrite a select statement that returns three columns from

SQL Write a SELECT statement that returns three columns from the Vendors table: VendorContactFName, VendorContactLName, and VendorName. Sort the result set by last name, then by first name.

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

In this section the student is required to develop a

In this section, the student is required to develop a technical debate based on his/her understanding using available scientific literature. The answer to this question should not exceed three A4 Pages. In the traditiona ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As