Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4) Based on the following database schemas: Homestay (homestayNo (PK), homestayName, address, telNo, city) Room (roomNo, homestayNo (PK), type, price) Booking (homestayNo, guestNo (PK), dateFrom,

4) Based on the following database schemas: Homestay (homestayNo (PK), homestayName, address, telNo, city) Room (roomNo, homestayNo (PK), type, price) Booking (homestayNo, guestNo (PK), dateFrom, dateTo, roomNo) Guest (guestNo (PK), guestName, guestAddress, guestTelNo)

Assume the following indexes exist: a) a hash index with no overflow on the roomNo and homestayNo as a composite primary key in Room; b) a clustering index on the foreign key attributes homestayNo in Room; c) a B+-tree index on the price attribute in Room; d) a secondary index on the attribute type in Room.

nTuples(Room) = 20000 bFactor(Room) = 200 nTuples(Homestay) = 100 bFactor(Homestay) = 40 nTuples(Booking) = 100000 bFactor(Booking) = 60 nDistincthomestayNo(Room) = 50 nDistinctroomNo(Booking) = 150 nDistincttype(Room) = 10 nDistincthomestayName(Homestay) = 50 nDistinctprice(Room) = 500 maxprice(Room) = 500 minprice(Room) = 200 nLevelstype(I) = 2 nLevelshomestayNo(I) = 2 nLfBlocksprice(I) = 50 nLevelsprice(I) = 2 Log2100 = 6.64 Log250 = 5.64

Calculate the SELECTION CARDINALITY and ESTIMATED COST for:

Selection: type=Flat price < 200 (Room)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Modern Advanced Accounting In Canada

Authors: Hilton Murray, Herauf Darrell

7th Edition

1259066487, 978-1259066481

Students also viewed these Accounting questions

Question

Define critical thinking and list its seven standards.

Answered: 1 week ago