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

image text in transcribedimage text in transcribed

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) The data type of the attributes hotelNo, roomNo, guestNo, and the price is INT. The data type of the attributes dateFrom and dateTo is DATETIME. The data type of the rest of the attributes is VARCHAR (200) Important Note: Provide the following resources when submitting Lab Assignment 1. a) SQL Statement in plain text format for each question. b) After executing SQL, provide SQL management Studio's screenshot for each question where SQL Statement and the respective Result Set are visible. stions: 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 1 Name2" , guestAddress = "456 Abc Street, City" guestNo =9, guestName = "fName3 lName3", guestAddress = "789 Abc Street, City" Booking: hotelNo =1, guestNo =7, dateFrom =12/12/2022, date To =12/15/2022, roomNo =4 hotelNo =2, guestNo =8, dateFrom =12/13/2022, date To=12/16/2022, roomNo =5 hotelNo =3, guestNo =9, dateFrom =12/14/2022, date To =12/17/2022, roomNo =6 Display all records in relation Hotel. 1- Display all records with only guestName and guestAddress attributes from relation Guest. 5- Update price to 85 in relation Room where roomNo =4. 5- Do a Union for relations Hotel and Hotel1. 7- Do a UNION ALL for relations Hotel and Hotel1. 3- Do an INNER JOIN between relations Hotel and Booking on attribute hotelNo. Do a LEFT JOIN between relations Guest and Booking on attribute guestNo. 10- Do a RIGHT JOIN between relations Hotell and Booking on attribute hotelNo. 1- Delete a record in relation Booking where guestNo =9 and hotelNo =3 and roomNo =6. 12- How many total hotels are there in relation Hotel? 13- What is the sum of all prices in relation Room? 14- List the number of rooms in each hotel. 5- 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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

4. What sales experience have you had?

Answered: 1 week ago