Describe the relations that would be produced by the following relational algebra operations:

What will be an ideal response?

a) ?hotelNo (?price ? 50 (Room) )
This will produce a relation with a single attribute (hotelNo) giving the number of those
hotels with a room price greater than £50.
b) ?Hotel.hotelNo ? Room.hotelNo(Hotel ? Room)
This will produce a join of the Hotel and Room relations containing all the attributes of
both Hotel and Room (there will be two copies of the hotelNo attribute). Essentially this
will produce a relation containing all rooms at all hotels.
c) ?hotelName (Hotel Hotel.hotelNo ? Room.hotelNo (?price ? 50 (Room)) )
This will produce a join of Hotel and those tuples of Room with a price greater than £50.
Essentially this will produce a relation containing all hotel names with a room price above
£50.
d) Guest (?dateTo ? ‘1-Jan-2007’ (Booking))
This will produce a (left outer) join of Guest and those tuples of Booking with an end date
(dateTo) greater than or equal to 1-Jan-2007. All guests who don’t have a booking with
such a date will still be included in the join. Essentially this will produce a relation
containing all guests and show the details of any bookings they have beyond 1-Jan-2002.
e) Hotel Hotel.hotelNo ? Room.hotelNo (?price ? 50 (Room)) )
This will produce a (semi) join of Hotel and those tuples of Room with a price greater
than £50. Only those Hotel attributes will be listed. Essentially this will produce a relation
containing all the details of all hotels with a room price above £50.
f) ?guestName, hotelNo (Booking Booking.guestNo ? Guest.guestNo Guest) ?
?hotelNo (?city ??’London’(Hotel))

Computer Science & Information Technology

You might also like to view...

What value is assigned to the half variable?

Please examine the following code sample: ``` int distance; // Declare distance as an int double half; // Declare half as a double distance = 35; // Assign 35 to distance half = distance / 2; // Calculate half the distance ``` a. 70 b. 17.5 c. 18 d. 17

Computer Science & Information Technology

The __________ method in the Queue interface retrieves, but does not remove, the head of this queue, throwing an exception if this queue is empty.

a. poll() b. remove() c. peek() d. element()

Computer Science & Information Technology