The following relations form part of a database held in a RDBMS: Hotel(HotelNo,
ID: 3621044 • Letter: T
Question
The following relations form part of a database held in a RDBMS:Hotel(HotelNo, Name, Location)
Room (RoomNo, HotelNo, Type, Price)
Booking(HotelNo, GuuestNo, DateFrom, DateTo, RoomNo)
Guest (GuestNo, Name, Address)
Queries:
1. List full details of all hotels.(i.e, HotelNo, Name and Location)
2. List full details of all hotels in Atlanta.
3. List the names of all guests in Atlanta, alphabetically ordered by name.
4. .List all double rooms (room types could be single, double, etc.) with a price below $50.00
5. Display the average price of a room.
6.Display the total potential revenue per night from all double rooms.
7.List the price and type of all rooms at the XYZ Hotel.
Explanation / Answer
1. SELECT * FROM Hotel; 2. SELECT * FROM Hotel WHERE Location = ‘Atlanta’; 3. SELECT name FROM Guest WHERE Location = ‘Atlanta’ ORDER BY Name 4. SELECT * FROM Room WHERE Price < 50 AND Type = 'D'; 5. SELECT AVG(Price) FROM Room; 6. SELECT SUM(price) FROM Room WHERE type = 'D'; 7. SELECT Price, Type FROM Room WHERE HotelNo = (SELECT HotelNo FROM Hotel WHERE Name = 'XYZ');Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.