Question: CREATE TABLE EXPLORER ( ExplorerID smallint not null, ExplrName VARCHAR ( 3 0 ) NOT NULL, Age smallint, FromEarth tinyint, Military tinyint, CONSTRAINT Explorer _
CREATE TABLE EXPLORER
ExplorerID smallint not null,
ExplrName VARCHAR NOT NULL,
Age smallint,
FromEarth tinyint,
Military tinyint,
CONSTRAINT Explorerpk PRIMARY KEYExplorerID
;
CREATE TABLE RESOURCE
ResourceID INT autoincrement,
Category varchar CHECK Category INGold'Medicine','Rare Mineral','New Weapon','Technology','Other'
DateOfMission date,
ExplorerID smallint,
CONSTRAINT ResourceIDpk PRIMARY KEYResourceID
constraint missionfk FOREIGN KEYExplorerID REFERENCES EXPLORERExplorerID ON DELETE CASCADE
;
CREATE TABLE VESSEL
VesselID SMALLINT NOT NULL,
VesselName VARCHAR
NumOfLaserCannons smallint,
VesselType varchar
CONSTRAINT Vesselpk PRIMARY KEYVesselID
;
ALTER TABLE VESSEL ADD CONSTRAINT checkVesseltype CHECK VesselType INInterceptorclass','Excelsiorclass','Galaxyclass','Defiantclass','Nebulaclass';
CREATE TABLE RESERVATION
ReservationNum INT AUTOINCREMENT,
CheckOutDate DATE,
CheckInDate DATE,
ReturnDueDate DATE,
ExplorerID smallint,
VesselNum smallint,
CONSTRAINT reservationpk PRIMARY KEYReservationNum
CONSTRAINT reservationfk FOREIGN KEY ExplorerID REFERENCES EXPLORERExplorerID ON DELETE CASCADE,
CONSTRAINT reservationfk FOREIGN KEY VesselNum REFERENCES VESSELVesselID ON DELETE CASCADE
;
##EXPLORER rows
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Chris Aldrin',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Peggy Glenn',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Buzz Armstrong',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Alan Gagarin',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Michael Hadfield',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Mae Ride',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Yuri Whitson',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'John Jemison',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Neil Shepard',;
INSERT INTO EXPLORERExplorerID ExplrName, Age,FromEarth, Military VALUES 'Sally Collins',;
##VESSEL rows
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Prometheus','Excelsiorclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Exeter','Interceptorclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Rotarran','Galaxyclass';
INSERT INTO VESSELVesselID VesselName,
NumOfLaserCannons,VesselType VALUES 'Venture','Nebulaclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Valiant','Galaxyclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES Dderidex'Excelsiorclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Bajoran','Nebulaclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Maquis Raider','Defiantclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Enterprise','Interceptorclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Negh''Var','Galaxyclass';
INSERT INTO VESSELVesselID VesselName, NumOfLaserCannons,VesselType VALUES 'Lexington','Nebulaclass';
Write a single query that will list the only Explorer who did NOT travel on a Galaxyclass vessel. The result set should have row and display the ExplrName column only. Hint: Your query can use subqueries table joins or both.
##Paste below: copy your SQL code out of mySQL WB screenshot of the result set displayed
SQL QUERY CODE to display the result set:
RESULT SET SCREENSHOT:
Write a single query that will list the Explorer ID and Name of the Explorers who reserved a Galaxyclass but never reserved an Interceptorclass. The result set should have rows. Hint: Nested subqueries
##Paste below: copy your SQL code out of mySQL WB screenshot of the result set displayed
SQL QUERY CODE to display the result set:
RESULT SET SCREENSHOT:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
