Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PART ONE: Please type the CREATE TABLE commands for the following tables: PART T

ID: 3840160 • Letter: P

Question

PART ONE:

Please type the CREATE TABLE commands for the following tables:

PART TWO:

2) Type the INSERT INTO commands for these tables:

This table is inserted into "GUIDE"

This table is inserted into "TRIP"

...TRIP TABLE CONTINUED

This table is inserted into "CUSTOMER"

This table is inserted into "RESERVATION"

This table is inserted into "TRIP_GUIDES"

GUIDE Column GUIDE NUM LAST NAME FIRST NAME ADDRESS CITY STATE POSTAL CODE PHONE NUM HIRE DATE Type CHAR CHAR CHAR CHAR CHAR CHAR CHAR CHAR DATE Length 15 15 25 25 2 12 Decimal places Nulls allowed? Description Guide number (primary key) Guide last name Guide first name Guide street address Guide city Guide state Guide postal code Guide phone nu Date guide was hired

Explanation / Answer

PART1:-

SQL code to create the table GUIDE:-

CREATE TABLE GUIDE (
Column varchar(25),
Type varchar(25),
Length Int,
Decimal_Places DECIMAL,
Nulls_allowed Boolean,
Description varchar(25)
);

SQL code to INSERT the data into the table GUIDE:-

Example:-

INSERT INTO GUIDE ( Column,Type,Length,Decimal_Places,Nulls_Allowed,Description)
VALUES ('GUIDE_NUM','CHAR',4,3,'YES','Guide Number');

SQL code to create the table TRIP:-

CREATE TABLE TRIP (
Column varchar(10),
Type varchar(15),
Length int,
Decimal_Places DECIMAL,
Nulls_allowed Boolean,
Description varchar(25)
);

SQL code to INSERT the data into the table TRIP:-

Example:-

INSERT INTO TRIP ( Column,Type,Length,Decimal_Places,Nulls_Allowed,Description)
VALUES ('GUIDE_NUM','CHAR',4,3,'YES','Guide Number');

SQL code to create the table CUSTOMER:-

CREATE TABLE CUSTOMER (
Column varchar(10),
Type varchar(15),
Length int,
Decimal_Places DECIMAL,
Nulls_allowed Boolean,
Description varchar(25)
);

SQL code to INSERT the data into the table CUSTOMER:-

Example:-

INSERT INTO CUSTOMER ( Column,Type,Length,Decimal_Places,Nulls_Allowed,Description)
VALUES ('GUIDE_NUM','CHAR',4,3,'YES','Guide Number');

PART2:-

SQL code to INSERT the data into the table GUIDE:-

INSERT INTO GUIDE ( GUIDE_NUM,LAST_NAME,FIRST_NAME,ADDRESS,CITY,STATE,PoSTAL_CODE,PHONE_NUM,HIRE_DATE) VALUES ('AM01','Abrams','Miles','54 Quest Ave','Williamsburg','MA',01096,617-555-6032,'2012-6-3');

SQL code to INSERT the data into the table TRIP:-

INSERT INTO TRIP ( TRIP_ID,TRIP_NAME,START_LOCATION,STATE,DISTANCE,MAX_GRP_SIZE,TYPE,SEASON)
VALUES (1,'Arethusa Falls','Harts Location','NH',5,10,'Hiking','Summer');

SQL code to INSERT the data into the table RESERVATION:-

INSERT INTO RESERVATION ( RESERVATION_ID,TRIP_ID,TRIP_DATE,NUM_PERSONS,TRIP_PRICE,OTHER_FEES,CUSTOMER_NUM)

VALUES (1600001,40,'2016-3-26,2,$55.00,$0.00,101);

SQL code to INSERT the data into the table TRIP_GUIDES:-

INSERT INTO TRIP_GUIDES ( TRIP_ID,GUIDE_NUM)
VALUES (1,GZ01);