Question
Create the following four relations, i.e., Hotel, Hotel1, Room, Guest, Booking, with their respective attributes in SQL Server using the graphical user interface (GUI) (not
Create the following four relations, i.e., Hotel, Hotel1, Room, Guest, Booking, with their respective attributes in SQL Server using the graphical user interface (GUI) (not using SQL):
Hotel (hotelNo, hotelName, city)
Hotel1 (hotelNo, hotelName, city)
Room (roomNo, hotelNo, type, price)
Guest (guestNo, guestName, guestAddress)
Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)
Add the following records in the relations Hotel, Hotel1, Room, Guest, and Booking, respectively.
Hotel:
hotelNo = 1, hotelName = Hotel 123, city = City ABC
hotelNo = 2, hotelName = Hotel 456, city = City DEF
hotelNo = 3, hotelName = Hotel 789, city = City GHI
Hotel1:
hotelNo = 10, hotelName = Hotel 321, city = City JKL
hotelNo = 11, hotelName = Hotel 654, city = City MNO
hotelNo = 3, hotelName = Hotel 789, city = City GHI
Room:
roomNo = 4, hotelNo = 1, type = Standard, price = 80
roomNo = 5, hotelNo = 2, type = Queen, price = 90
roomNo = 6, hotelNo = 3, type = Quad, price = 1000
Guest: guestNo = 7, guestName = fName1 lName1" , guestAddress = 123 Abc Street, City
guestNo = 8, guestName = fName2 lName2" , guestAddress = 456 Abc Street, City
guestNo = 9, guestName = fName3 lName3" , guestAddress = 789 Abc Street, City
Booking:
hotelNo = 1, guestNo = 7, dateFrom = 12/12/2022, dateTo = 12/15/2022, roomNo = 4
hotelNo = 2, guestNo = 8, dateFrom = 12/13/2022, dateTo = 12/16/2022, roomNo = 5
hotelNo = 3, guestNo = 9, dateFrom = 12/14/2022, dateTo = 12/17/2022, roomNo = 6
PLEASE PROVIDE THE SQL SYNTAX THAT PRODUCES EACH RESULT BELOW
1. How many total hotels are there in relation Hotel?
2. What is the sum of all prices in relation Room?
3. List the number of rooms in each hotel.
4. List the number of rooms in each hotel in city City ABC
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