Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions