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...

Which of the following is not a bitwise operator?

a. ^ b. >> c. ~ d. *

Computer Science & Information Technology

To change the text orientation from portrait to landscape and back again, you add a section ________ before and after the landscape-oriented text

A) break B) terminator C) indicator D) marker

Computer Science & Information Technology

A(n) _________ is a document containing contact information for the people to be notified in the event of an incident.

A. emergency notification system B. alert roster C. phone list D. call register

Computer Science & Information Technology

An organization's file server has been virtualized to reduce costs. Which of the following types of backups would be MOST appropriate for the particular file server?

A. Snapshot B. Full C. Incremental D. Differentia

Computer Science & Information Technology