Question
The relations given below are part of a database schema for a hotel management system. Assume that these relations have been populated with suitable data
The relations given below are part of a database schema for a hotel management system. Assume that these relations have been populated with suitable data as appropriate, and the underlined attribute is a primary key.
Hotel (hotelNo, hotelName, city)
Room (roomNo, hotelNo, type, price)
Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)
Guest (guestNo, guestName, guestAddress)
where Hotel contains hotel details and hotelNo is the primary key;
Room contains room details for each hotel and (roomNo, hotelNo) forms the primary key;
Booking contains details of the bookings and (hotelNo, guestNo, dateFrom) forms the primary key; and
Guest contains guest details and guestNo is the primary key.
Write a relational algebra expression for each of the following data retrieval requirement:
(i) Produce a relation containing the hotel number of those hotels with a room price greater than 50.
(ii) Produce a relation containing the details of all rooms at all hotels.
(iii) Produce a relation containing all hotel names with a room price below 100.
(iv) Produce a relation containing all guests and show the details of any bookings they have beyond 1-Jun-2016.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started