Database Systems 6th E X HB1hBPMTX2JmUnVYbVpYWk0/view For the following exercise
ID: 3593077 • Letter: D
Question
Database Systems 6th E X HB1hBPMTX2JmUnVYbVpYWk0/view For the following exercises, use the Hotel schema defined at the start of the Exercises at the end of Chapter 4 s.8 Descnbe the relations that would be produced by the following relational algebra operations (b) .ow.oum-RoomhaeNo(Hotel × Room) (d) Guest 2 4 (-fo ·loor(Booking)) (e) Hotel bworeno-Reone-o(opte > glRoom)) 5.9 Provide the equivalent tuple relational calculus and domain relational calculus expressions for each of the relation algebra queries given in Exercise 5.8. 5.10 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) ER) (Room(R) H.hotelNo -R.hotelINo R.price> 50) (c) (H.hotelName | Hotel(H) (BB) (EG) (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) 5.11 Provide the equivalent domain relational calculus and relational algebra expressions for each of the tuple relationa calculus expressions given in Exercise 5.10 given in Exercise 510 5.12 Generate the relational algebra, tuple relational calculus, and domain relational calculus expressions for the follow ing quenes (a) List all hotels (b) List all singe rooms with a price below £20 per night. (c) List the names and cities of all guests (d) List the price and type of all rooms at the Grosvenor Hotel (e) List all guests currently staying at the Grosvenor Hotel. (0 List the details of all rooms at the Grosvenor Hotel, including the name of the guest staying in the room, if the room is occupied (g) List the guest details (guest guestName, and guestAddress) of all guests staying at the Grosvenor Hotel after 1990. The following tables form part of a database held in an RDBMS 5.13 Using relational algebra, produce a report of all employees from the IT and planning departments who are bom Employee (empNo. fName, IName, address, DOB, sex, position, deptNo) Department (deptNio, deptName, mgrEmpNo) Project(projNo, projName, deptNo) WorksOn (empNo. projNo, dateWorked, hoursWorked) where Employeecontains employee details and empNo is the key contains department details and deptNo is the key. mgrEmpNo identifies the employee who is the manager of the department There is only one maniger r DepartmentExplanation / Answer
5.10
1) {H.hotelName | Hotel(H) H.city = 'London'}
This will produce a relation containing the names of all hotels in London.
2){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
3){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
4){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.
5.11
Provide the equivalent relational algebra expressions:
1. hotelName (city = 'London' (Hotel) )
2. hotelName (Hotel Hotel.hotelNo = Room.hotelNo (price > 50 (Room)) )
3. ( (Guest) ( hotelName guestName = 'John Smith' Guest.guestN
5.12
1.
Generate the tuple relational calculus expressions: List all single rooms with a price below £20 per night.
TRC: {R | Room(R) R.type = 'S' R.price < 20}
2.
Generate the tuple relational calculus expressions: List all guests currently staying at the Grosvenor Hotel.
e.TRC: {G |Guest(G) ((B)(H) (Booking(B) Hotel(H) (B.dateFrom '01-01-15') (B.dateTo '01-01-15') (B.guestNo = G.guestNo) (B.hotelNo = H.hotelNo) (H.hotelName = 'Grosvenor Hotel')))}
3.
Generate the relational algebra expression for: List all single rooms with a price below £20 per night.
RA: type='S' price < 20(Room)
4.
Generate the relational algebra expression: List all guests currently staying at the Grosvenor Hotel.
RA: Guest ( (guestNo dateFrom '01-01-15' dateTo '01-01-15'Booking ( (Hotel))))
hotelNo hotelName = 'Grosvenor Hotel' (substitute '01-01-15' for today's date).
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.