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) = 200nTuples(Homestay) = 100 bFactor(Homestay) = 40nTuples(Booking) = 100000 bFactor(Booking) = 60nDistincthomestayNo(Room) = 50 nDistinctroomNo(Booking) = 150nDistincttype(Room) = 10 nDistincthomestayName(Homestay) = 50nDistinctprice(Room) = 500 maxprice(Room) = 500minprice(Room) = 200 nLevelstype(I) = 2nLevelshomestayNo(I) = 2 nLfBlocksprice(I) = 50nLevelsprice(I) = 2 Log2100 = 6.64Log250 = 5.64
Calculate theSELECTION CARDINALITY andESTIMATED COST for:
Selection: σtype=‘Flat’ ⋀ price < 200="">
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here