CUSTOMER INVOICE PK CUS_CODE INT(5) PK INV_NUMBER INT(5) FK CUs CODE INV DATE CUS LNAME VARCHAR(50) INT(5) CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE VARCHAR(50) DATETIME CHAR(1) LINE...


A) Write the SQL code that will create the table structure for table: PRODUCT.
Note:
P_CODE is the Primary Key
V_CODE is the Foreign Key that references the VENDOR table




B) Write the SQL code to enter two rows in the table VENDOR table.




C) Write a SQL to compute and display for each Customer the Total Purchases, Number of Purchases and Average Purchases when the Total Purchases are less than 2000 dollars.


CUSTOMER<br>INVOICE<br>PK CUS_CODE<br>INT(5)<br>PK INV_NUMBER INT(5)<br>FK CUs CODE<br>INV DATE<br>CUS LNAME<br>VARCHAR(50)<br>INT(5)<br>CUS FNAME<br>CUS INITIAL<br>CUS AREACODE<br>CUS PHONE<br>CUS BALANCE<br>VARCHAR(50)<br>DATETIME<br>CHAR(1)<br>LINE<br>CHAR(3)<br>PK.<br>CHAR(8)<br>INV NUMBER<br>INT(5)<br>FK<br>DECIMAL(13,2)<br>PK LINE NUMBER INT(2)<br>FK P CODE<br>INT(5)<br>INT(4)<br>DECIMAL(13,2)<br>LINE_UNITS<br>PRODUCT<br>LINE_PRICE<br>VENDOR<br>PK V_CODE<br>INT(5)<br>PK P_CODE<br>INT(5)<br>V_NAME<br>P_DESCRIPT VARCHAR(50)<br>VARCHAR(50)<br>VARCHAR(50)<br>V_CONTACT<br>P_INDATE<br>DATETIME<br>V_AREACODE<br>VARCHAR(50)<br>P_QOH<br>INT(4)<br>VARCHAR(50)<br>V_PHONE<br>V_STATE<br>V ORDER<br>P_MIN<br>INT(4)<br>VARCHAR(50)<br>P_PRICE<br>DECIMAL(13,2)<br>P DISCOUNT DECIMAL(13,2)<br>INT(5)<br>VARCHAR(50)<br>FK V_CODE<br>

Extracted text: CUSTOMER INVOICE PK CUS_CODE INT(5) PK INV_NUMBER INT(5) FK CUs CODE INV DATE CUS LNAME VARCHAR(50) INT(5) CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE VARCHAR(50) DATETIME CHAR(1) LINE CHAR(3) PK. CHAR(8) INV NUMBER INT(5) FK DECIMAL(13,2) PK LINE NUMBER INT(2) FK P CODE INT(5) INT(4) DECIMAL(13,2) LINE_UNITS PRODUCT LINE_PRICE VENDOR PK V_CODE INT(5) PK P_CODE INT(5) V_NAME P_DESCRIPT VARCHAR(50) VARCHAR(50) VARCHAR(50) V_CONTACT P_INDATE DATETIME V_AREACODE VARCHAR(50) P_QOH INT(4) VARCHAR(50) V_PHONE V_STATE V ORDER P_MIN INT(4) VARCHAR(50) P_PRICE DECIMAL(13,2) P DISCOUNT DECIMAL(13,2) INT(5) VARCHAR(50) FK V_CODE

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here