Question: Problem 4: SQL Queries (30 pts) Consider the following relations. The primary keys are underlined while the foreign keys are in italic. Hotel (HNum, Hname,

 Problem 4: SQL Queries (30 pts) Consider the following relations. The

primary keys are underlined while the foreign keys are in italic. Hotel

(HNum, Hname, Location) Room (RNum, H Num, Type, View, Price) Booking (ID,

Problem 4: SQL Queries (30 pts) Consider the following relations. The primary keys are underlined while the foreign keys are in italic. Hotel (HNum, Hname, Location) Room (RNum, H Num, 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 6. Write an SQL query to show all hotels along with the number of booking in there. 7. List the name of guests whose last name contains 'a' 8. List the names of hotels who has no booking in them 9. Find the room number with no booking, 10. Find the highest price and average price of room

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!