Question

In: Computer Science

Hotel (hotelno(PK), hotelname, city) •         Room (roomno (PK), hotelno (PK,FK), type, price) type can be single, double,...

Hotel (hotelno(PK), hotelname, city)

•         Room (roomno (PK), hotelno (PK,FK), type, price) type can be single, double, family

•         Booking (hotelno(PK,FK), guestno(PK,FK), startdate(PK), enddate, roomno(PK,FK))

•         Guest (guestno(PK), guestname, guestaddress)

1-Display on the screen the hotel name and city of all room type family.

2-Display hotel name and city for the guests currently staying at the Holiday Inn Hotel.

Solutions

Expert Solution

SOLUTION:

The following solution has been implemented in SQL SERVER database. Given below are the list of queries that represent the table creation and the queries corresponding to the SOLUTION concerned.

CREATION:


create table Hotel(hotelNo int PRIMARY KEY, hotelName varchar(30), city varchar(30));
create table Room(roomNo int, hotelNo int, type varchar(20), price decimal,
constraint pk_Room_Hotel primary key(roomNo, hotelNo));
alter table Room add constraint fk_Room_hotelNo FOREIGN KEY(hotelNo) REFERENCES Hotel(hotelNo);
create table Guest(guestNo int PRIMARY KEY, guestName varchar(50) NOT NULL, guestAddress varchar(100));
create table Booking(hotelNo int, guestNo int, dateFrom date, dateTo date, roomNo int,
constraint pk_Booking PRIMARY KEY(hotelNo,guestNo,dateFrom));

SAMPLE DATASET USED

SOLUTION QUERIES

1-Display on the screen the hotel name and city of all room type family.

SELECT hotelName, city 
FROM HOTEL 
WHERE hotelNo IN(SELECT hotelNo 
                                        FROM Room 
                                        WHERE Type='Family');

2-Display hotel name and city for the guests currently staying at the Holiday Inn Hotel.

SELECT Hotel.hotelName, Hotel.city FROM Booking, Hotel
WHERE Booking.hotelNo = Hotel.hotelNo and Hotel.hotelNo=(SELECT hotelNo 
                                FROM Hotel 
                                WHERE hotelName='Holiday Inn Hotel');

OUTPUT

Hope this helps.


Related Solutions

The management of 50-room Gordion Hotel, which has single and double rooms only, has acquired the...
The management of 50-room Gordion Hotel, which has single and double rooms only, has acquired the following internal financial data: • Occupancy of 65.00% • Projected after-tax average daily room rate (ADR) of $54.00 • 25.00% of double room occupancy • A price difference of $15.00 more for double rooms than the singles Based on the financial information given, calculate the individual ADRs for single and double rooms for Gordion. The operation team of H hotel, which has 25 rooms...
New York City is the most expensive city in the United States for lodging. The mean hotel room rate is $204 per night.
  New York City is the most expensive city in the United States for lodging. The mean hotel room rate is $204 per night. Assume that room rates are normally distributed with a standard deviation of $55. (a) What is the probability that a hotel room costs $265 or more per night? (Round your answer to four decimal places.) (b) What is the probability that a hotel room costs less than $120 per night? (Round your answer to four decimal...
New York City is the most expensive city in the United States for lodging. The mean hotel room rate is $204 per night.†
  New York City is the most expensive city in the United States for lodging. The mean hotel room rate is $204 per night.† Assume that room rates are normally distributed with a standard deviation of $55. (a) What is the probability that a hotel room costs $255 or more per night? (Round your answer to four decimal places.) (b) What is the probability that a hotel room costs less than $130 per night? (Round your answer to four decimal...
A 600​-room hotel can rent every one of its rooms at $90 per room. For each​...
A 600​-room hotel can rent every one of its rooms at $90 per room. For each​ $1 increase in​ rent, 3 fewer rooms are rented. Each rented room costs the hotel​ $10 to service per day. How much should the hotel charge for each room to maximize its daily​ profit? What is the maximum daily​ profit?
Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double...
Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double room: $75/night King room: $100/night Suite room: $150/night The size of the hotel chains in different locations may be different in terms of the number of floors and the type and the number of rooms on each floor. You are required to write a program that calculates the occupancy rate and the total hotel income for one night and displays this information as well...
Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double...
Project Description The BlueMont chain hotels have 4 different types of room: Single room: $60/night Double room: $75/night King room:   $100/night Suite room: $150/night The size of the hotel chains in different locations may be different in terms of the number of floors and the type and the number of rooms on each floor. You are required to write a program that calculates the occupancy rate and the total hotel income for one night and displays this information as well...
PROBLEM In the Hotel management domain, we have the following concepts: Hotel Hotel chain Hotel room  ...
PROBLEM In the Hotel management domain, we have the following concepts: Hotel Hotel chain Hotel room       Reservation Hilton Hilton San Diego Bayfront Meeting room Ballroom Guest Room Catering Service Internet Service       TV Service Guest Parking Service       Item on bill       You are asked to design a model, using a UML class diagram to relate the abovementioned concepts: Correctly use UML notations for relations such as generalization, association, aggregation, composition. Be careful to distinguish objects from classes. You...
identify the type of reaction for each of the following as combination, decomposition, single replacement double...
identify the type of reaction for each of the following as combination, decomposition, single replacement double replacement or combusion? a. a metal and a nonmetal form an ionic compound b. a compound of hydrogen and carbon reacta with oxgyen to produce carbon dioxide and water c. heating calcium carbonate produces calcium oxide abd carbon dioxide
The side chains of glutamic acid (pK 4.3) and arginine (pK 12.5) can form an ionic...
The side chains of glutamic acid (pK 4.3) and arginine (pK 12.5) can form an ionic bond under certain conditions. Draw the relevant portions of the side chains and indicate whether an ionic bond could form at the following: (a) pH 4; (b) pH 7; (c) pH 12; (d) pH 13.
Hubbart approach The Pimlico Hotel is a 200-room hotel and it is projected to cost $15...
Hubbart approach The Pimlico Hotel is a 200-room hotel and it is projected to cost $15 million including land, building, equipment, and furniture and working capital. The hotel is financed with a $10 million loan at 8% interest rate. The owner’s investment in the property is $5 million. The owners desire a 16% return on investment. The hotel projects 80% occupancy rate and it will be open 365 days a year. The income tax rate is 40%. Room’s department direct...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT