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.
What is the percentage of hotels still under construction? List the total number of hotels, number of hotels completed, the number of hotels under construction, and the percentage of hotels under construction. (Note: NO SUBQUERY; use OUTER JOIN with aggregates.)
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