Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

What tools might be helpful?

Answered: 1 week ago

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago