Question: Can someone help me with these questions? I am using SQL plus. This is database relations shema. Hotel (hotelNo, hotelName, hotelAddress, country) Room (roomNo, hotelNo,
Can someone help me with these questions?
I am using SQL plus.
This is database relations shema.
Hotel (hotelNo, hotelName, hotelAddress, country)
Room (roomNo, hotelNo, type, price)
Guest (guestNo, guestName, guestAddress, country)
Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo)
I created tables.
CREATE TABLE Hotel (hotelNo NUMBER(4) NOT NULL ,hotelName VARCHAR2(16) NOT NULL ,hotelAddress VARCHAR2(40) NOT NULL ,country VARCHAR2(20) NOT NULL ,PRIMARY KEY (hotelNo) );
CREATE TABLE Room (hotelNo NUMBER(4) NOT NULL ,roomNo NUMBER(4) NOT NULL ,type VARCHAR2(8) NOT NULL ,price NUMBER(6,2) NOT NULL ,PRIMARY KEY (hotelNo, roomNo) );
CREATE TABLE Guest (guestNo NUMBER(4) NOT NULL ,guestName VARCHAR2(15) NOT NULL ,guestAddress VARCHAR2(40) NOT NULL ,country VARCHAR2(20) NOT NULL ,PRIMARY KEY (guestNo) );
CREATE TABLE Booking (hotelNo NUMBER(4) NOT NULL ,guestNo NUMBER(4) NOT NULL ,dateFrom DATE NOT NULL ,dateTo DATE ,roomNo NUMBER(4) NOT NULL ,PRIMARY KEY (hotelNo, guestNo, dateFrom) );
-Use only a single query statement to solve each query question.
-Do NOT use subqueries for this
By the way, you don't have to calculate anything for these questions since you don't have data.
I couldn't able to post data because it was too long.
Please just provide me codes about how to do it.
Here is the question.
5. List the type and price of all rooms at the hotels with 'Grosvenor' in name, including the number of rooms for each possible combination of type and price. List only if the number of rooms for each type and price combination is greater than 3. [Note: Consider which output columns are required to make the data meaningful to interpret.]
6. Include also the roomNo in the output. Include all guest information in the output. Use 2021-01-25 as the current date.
7. Do this question for each of the hotels with 'Grosvenor' in name. Use 2021-01-25 as the current date.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
