Describe the relations that would be produced by the following tuple relational calculus expressions:
(a) {H.hotelName | Hotel(H) ? H.city = ‘London’}
(b) {H.hotelName | Hotel(H) ? (?R) (Room(R) ? H.hotelNo ? R.hotelNo?? R.price ?50)}
(c) {H.hotelName | Hotel(H) ? (?B) (?G) (Booking(B) ? Guest(G) ? H.hotelNo ?
B.hotelNo?? B.guestNo = G.guestNo ?? G.guestName = ‘John Smith’)}
(d) {H.hotelName, G.guestName, B1.dateFrom, B2.dateFrom | Hotel(H) ? Guest(G) ?
Booking(B1) ? Booking(B2) ? H.hotelNo ? B1.hotelNo??
G.guestNo = B1.guestNo ?? B2.hotelNo = B1.hotelNo ?
B2.guestNo = B1.guestNo ?? B2.dateFrom ? B1.dateFrom}
(a) {H.hotelName | Hotel(H) ? H.city = ‘London’}
This will produce a relation containing the names of all hotels in London.
(b) {H.hotelName | Hotel(H) ? (?R) (Room(R) ? H.hotelNo ? R.hotelNo?? R.price ?50)} This will produce a relation containing the names of all hotels that have a room price
above £50.
(c) {H.hotelName | Hotel(H) ? (?B) (?G) (Booking(B) ? Guest(G) ? H.hotelNo ?
B.hotelNo?? B.guestNo = G.guestNo ?? G.guestName = ‘John Smith’)}
This will produce a relation containing the names of all hotels that have a booking for
a guest called John Smith.
(d) {H.hotelName, G.guestName, B1.dateFrom, B2.dateFrom | Hotel(H) ? Guest(G) ?
Booking(B1) ? Booking(B2) ? H.hotelNo ? B1.hotelNo??
G.guestNo = B1.guestNo ?? B2.hotelNo = B1.hotelNo ?
B2.guestNo = B1.guestNo ?? B2.dateFrom ? B1.dateFrom}
This will produce a relation containing the names of guests who have more than one booking at the same hotel, along with the hotel number and the dates of the bookings.
You might also like to view...
________ are dashed lines that display on your slide when you are moving an object
Fill in the blank(s) with correct word
How many files are displayed now, more than before? Explain.
Work with hidden files in Linux. a. In Linux, files with names that begin with a ‘.’ (single dot) are not shown by default. While dot-files have nothing else special about them, they are called hidden files because of this feature. Examples of hidden files are .file5, .file6, .file7. b. Use ls -l to display the files stored in the analyst home directory.
[analyst@secOps ~]$ ls –lc. Use the ls -la command to display all files in the home directory of analyst, including the hidden files.
[analyst@secOps ~]$ ls –la