Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following relations. The primary keys are underlined while the foreign keys are in italic. Hotel (HNum, Hname, Location) Room (RNum , HNum ,
Consider the following relations. The primary keys are underlined while the foreign keys are in italic.
Hotel (HNum, Hname, Location)
Room (RNum, HNum, Type, View, Price)
Booking (ID, HNum, GHum, RNum, DateFrom, DateTo)
Guest (GNum, Fname, Lname, Gender, DOB, City)
Write the corresponding SQL queries for the below questions
- List fist name, last name and address of all guests in descending order by First name
- List the name of the hotels located in Paris or Toulouse.
- List names of hotels that have rooms booked by Steve Martin
- List all information about the rooms that has a price below the average price of all single rooms
- For each Hotel, List the total number of Rooms.
- Write an SQL query to show all hotels along with the number of booking in there.
- List the name of guests whose last name contains a
- List the names of hotels who has no booking in them
- Find the room number with no booking.
- Find the highest price and average price of room.
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