Details of this Paper

SQL PLUS(ORACLE)

Description

solution


Question

I NEED help trying to get my foreign key to compile.;Check my code on the tables, please let me know what is wrong here;CREATE TABLE REP(REP_ID char(3), REP_LNAME varchar(20) NOT NULL;REP_FNAME varchar(20) NOT NULL, REP_STREET char(15), REP_CITY varchar(20) NOT NULL;REP_STATE char(2), REP_ZIP char(5), REP_COMM decimal(7,2);REP_RATE decimal(2,2),PRIMARY KEY(REP_ID));CREATE TABLE CUSTOMER(CUST_ID char(4), CUST_NAME varchar(50) NOT NULL;CUST_STREET char(20), CUST_CITY varchar(20) NOT NULL, CUST_STATE char(2);CUST_ZIP char(5), CUST_BALANCE decimal(7,2), CUST_LIMIT decimal(7,2);PRIMARY KEY(CUST_ID);FOREIGN KEY(REP_ID) REFERENCES REP);CREATE TABLE PRODUCT(PROD_ID char(5), PROD_DESC varchar(30) NOT NULL;PROD_QUANTITY char(3), PROD_TYPE char(2), PROD_WAREHOUSE char(1);PROD_PRICE decimal(5,2);PRIMARY KEY(PROD_ID);CREATE TABLE INVOICE(INVOICE_NUM char(5), INVOICE_DATE DATE;FOREIGN KEY(CUST_ID) references CUSTOMER(CUST_ID));CREATE TABLE LINE (LINE_NUM_ORDERED char(2), LINE_PRICE decimal(5,2);FOREIGN KEY(INVOICE_NUM) references INVOICE(INVOICE_NUM));FOREIGN KEY(PROD_ID) references PRODUCT(PROD_ID))

 

Paper#68212 | Written in 18-Jul-2015

Price : $27
SiteLock