Question: Please answer CLEARLY and LEGIBLE from question 5-15. Consider the database model below: The database model FIGURE 7.1 CUSTOMER INVOICE LINE PK INV PK.FK1 |INV
Consider the database model below: The database model FIGURE 7.1 CUSTOMER INVOICE LINE PK INV PK.FK1 |INV NUM?ER PK ?LINE.NUMBER PK CUS CODE generates FK1 CUS CODE CUS LNAME CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE INV DATE FK2 P CODE LINE UNITS LINE PRICE is found in VENDOR PRODUCT PK P CODE V NAME V-CONTACT V AREACODE V PHONE V STATE V ORDER P DESCRIPT -sug-es- -O P INDATE P MIN P PRICE P DISCOUNT FK1 V CODE Write the SQL code for creating the database and all the above tables. State all primary keys and foreign keys constraints. CUSTOMER: CUS_ CODE(Numeric), CUS-FNAME, CUS LNAME, CUS-INITIAL, AREACODE, CUS- PHONE(strings), CUSR BALANCE(numeric) VENDOR: VCODE (integer), V NAME, vCONTACT, V.AREACODE, V.PHONE, V STATE, V ORDER(string) PRODUCT: P.DESCRIPT (String), P INDATE (date), P.Q0H, P MIN, P PRICE, P DISCOUNT(numeric), INVOICE: INV_NUMBER (numeric), INV_DATE (date) LINE: LINE NUMBER, LINE_UNITS, LINE PRICE (numeric), P_CODE(string). Write the SQL queries to retrieve the following: 1) The description, quantity on hold(P Q0H), the minimum quantity and the price for each product whose price is below $10.00 The description, quantity on hold(P_QOH), the minimum quantity, the price and the date for each product whose inventory date (P_ INDATE) is on or after January 20, 2012 2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
