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...
In the pseudocode of the textbook, a class __________ starts with the word Class, followed by the name of the class.
a. body b. definition c. members d. data
Write a function to mirror along the diagonal from (0, height) to (width, 0).
What will be an ideal response?
The ____ displays a grid for choosing the number of rows and columns for your table.
A. Borders pop-up menu B. Thumbnail pane C. Table pop-up menu D. sidebar
Case 3-2 You are having a lot of trouble placing images in your Visual Basic application. You ask your programming partner Siobhan what might be going on. With your second image, you want no changes made to the image size or the size of the PictureBox object and you want Visual Studio to place the image in the PictureBox object with the upper-left corner of the image and the upper-left corner of the PictureBox object aligned. To which of the following SizeMode list options in the Properties window for the PictureBox object does Siobhan direct you?
A. AutoSize B. Normal C. Zoom D. CenterImage