(a)
Based on the schema above, describe the relations that would be produced by the following relational algebra operations:
i.
ΠhotelNo (σprice > 50 (Room) ) [2 Marks]
ii.
σHotel.hotelNo = Room.hotelNo(Hotel × Room) [2 Marks]
iii.
ΠhotelName (Hotel ⊳⊲ Hotel.hotelNo = Room.hotelNo (σprice > 50 (Room)) ) [3 Marks] iv. ΠuestName, hotelNo (Booking ⊳⊲ Booking.guestNo = Guest.guestNo Guest) ÷
ΠhotelNo (σcity = ’London’(Hotel)) [3 Marks] v. Guest ⊐⊲ (σdateTo ≥ ‘1-Jan-2002’ (Booking)) [2 Marks]
vi. Hotel
SHAPE * MERGEFORMAT
Hotel.hotelNo = Room.hotelNo (σprice > 50 (Room)) ) [3 Marks]
(b)
Write a relation algebra operation that would the answer for each of the following:
i.
List the names and addresses of all guests in Kuala Lumpur, alphabetically
ordered by name. [3 Marks] ii. List the bookings for which no dateTo has been specified. [3 Marks] iii. List the number of rooms in each hotel in London. [3 Marks] iv. List the price and type of all rooms at the Ero Hotel. [3 Marks] v. Produce the number of guest made bookings for August. [4 Marks] vi. List all guests currently staying at the Grosvenor Hotel. [4 Marks]
#List #names #addresses #guests #Kuala #Lumpur