Question

Answer all questions on paper: Consider the database model below The database model FIGURE 7.1 CUSTOMER INVOICE LINE PK CUS CODE INV NUMBER FK1 CUS_COOE NV DATE CUS LNAME CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE LINE UNITS LINEPRICE - isfound in VENDOR PRODUCT V NAME supplies P INDATE P DESCRIPT CONTACT de- V AREACODE V PHONE V STATE V ORDER ?,.QOH P MIN P PRICE 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: V-cODE (integer), V_NAME, VCONTACT, V AREACODE, V_PHONE, V_STATE, V_ORDER(string) PRODUCT: P.DESCRIPT(String), P INDATE (date), P.00H, P.MIN, P.PRICE, PDISCOUNT(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 ) The description, quantity on hold(P_Q0H), the minimum quantity, the price and the date for whose price is below $10.00 each product whose inventory date (P_INDATE) is on or after January 20, 2012
media%2Fc8c%2Fc8c59e29-e49d-4782-95f4-68
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

The first four subparts have been answered as per Chegg guidelines, please repost others.

1)

SELECT description, MIN(P_QOH), unitPrice FROM Product. WHERE unitPrice<'10.00'

2)

SELECT description, MIN(P_QOH), P_INDATE FROM Product. WHERE P_INDATE >'January 20, 2012'

3)

SELECT description, P_QOH, unitPrice, SUM(unitPrice) AS TOTValue FROM Product.

4)

SELECT prdoductID, recieveDate, (recieveDate+90) AS ExpDate FROM Product.

5)

SELECT productID FROM Supply WHERE vendorNumber= '21344' OR vendorNumber= '24288'

6)

SELECT description, P_INDATE, price, date FROM Product WHERE (P_INDATE> 'January 15 2015' AND price<'50') OR vendorNumber= '24288'

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Add a comment
Know the answer?
Add Answer to:
Answer all questions on paper: Consider the database model below The database model FIGURE 7.1 CUSTOMER...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Creating SQL Queries: IUCT 1SOMER P DESCRIPT P INDATE P.0OH P MN p RCE P DISCOUNT...

    Creating SQL Queries: IUCT 1SOMER P DESCRIPT P INDATE P.0OH P MN p RCE P DISCOUNT as DE CUS LNAME Cus ANAME aus INITIA auS AREACODE CuS PHONE CUs BALANCE VENDOR UNE V NAVE V CONTACT V AREACCDE V PHONE V STATE V ORDER INVOCE INV NUMEER CUS CODE INV DATE TNE NUMEER P 00DE UNE UNITS UNE PRICE MROME BMP NIM MP TITLE EMP LNAME BMP RNAME eMP INITIAL BMP DCB EMP HIRE DATE EMP AREACODE EMP PHONE CREATE...

  • 2. Find the maximum QOH of all products. it generates INVOICE PK IN NUMBER FK1CuS_CODE INV_DATE...

    2. Find the maximum QOH of all products. it generates INVOICE PK IN NUMBER FK1CuS_CODE INV_DATE contains CUSTOMER PK CUS_CODE CUS_LNAME CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS_BALANCE + LINE PKFK1 INV_NUMBER +PX LINE NUMBER FK2 P CODE LINE_UNITS LINE_PRICE is found in VENDOR PKY_CODE V_NAME CONTACT HF - Supplies PRODUCT PK ecoot P_DESCRIPT P_INDATE P QOH P_MIN P PRICE P_DISCOUNT FK1V_CODE V_AREACODE V_PHONE V_STATE V_ORDER

  • We will use a simple database composed of the following tables: CUSTOMER, INVOICE, LINE, PRODUCT, and...

    We will use a simple database composed of the following tables: CUSTOMER, INVOICE, LINE, PRODUCT, and VENDOR. This database model is shown in Figure 1. The database model in Figure 1 reflects the following business rules: - A customer may generate many invoices. Each invoice is generated by one customer. - An invoice contains one or more invoice lines. Each invoice line is associated with one invoice. - Each invoice line references one product. A product may be found in...

  • DML: Illustrative DataBase Column DataType SizeDecimal Domain PK? FK? Positions PRODUCT LINE PCODE PDESCRIPT Character1-35 Character...

    DML: Illustrative DataBase Column DataType SizeDecimal Domain PK? FK? Positions PRODUCT LINE PCODE PDESCRIPT Character1-35 Character 8 P INDATE Date P ONHAND Numeric P MIN P PRICE P DISCOUNT Numeric V CODE Numeric601000000 VENDOR PRODUCT Valid date Numeric Numeric z 0 0.00 & s 1.00 V NAME Character 1-35 V CONTACT Character 1 2 V AREACODE Numeric V PHONE Numeric Character Character 100 & 5 999 e 1010000 Alphabetic Y. 'N V ORDER Questions Given the metadata above for columns...

  • Need to find the partial and transitive dependencies of the following fields: cust_code = code that...

    Need to find the partial and transitive dependencies of the following fields: cust_code = code that identifies a customer cus_lname = customer last name cus_areacode = area code of the 7 digit phone number of a customer cus_initial = customer initials cus_balance = balance to be paid by the customer cus_phone = 7 digit phone number cus_fname = customer first name inv_number = number representing an invoice inv_date = date of the invoice line_number = an invoice contains many items...

  • What would I have to write into the MySQL Workbench query to execute these commands? -...

    What would I have to write into the MySQL Workbench query to execute these commands? - Show all vendor information with vendor contact information in upper case like "SMITH". - Show the customer balance in total, in average, in minimized and in maximized value. - Show all customer information whose balance is greater than $500. - Aggregate the total cost of products grouped by V_CODE, and only show the records with total exceeds $500, and list the records in descending...

  • Consider the following relations. Product: (Product#, p-description, p-indate, p-price) Vendor: (V-code, v-name, v-address) Purchase: (Product#, V-code,...

    Consider the following relations. Product: (Product#, p-description, p-indate, p-price) Vendor: (V-code, v-name, v-address) Purchase: (Product#, V-code, date) Write an SQL query to list the prices of the products that were purchased on 9 December 2019

  • Please highlight was is needed. I have completed # 2, 6, and I beleive 7. Everything...

    Please highlight was is needed. I have completed # 2, 6, and I beleive 7. Everything related to show 7 needs to be highlighted purple which was everything with capital letters needs to be highlighted purple which I have done. The yellow highlight shows all the empty lines which are highlighted already as well. If I could get the rest done that would be great. 1. All SQL scripts should be written to execute in a SQL Server 2016 database....

  • this is about databases and SQL, please help me with this and i promise i will...

    this is about databases and SQL, please help me with this and i promise i will thumbs you up :) let me know if you need more info please try to get this done i will definitely thumbs you up :)) PROJECT TOPIC: Library: Books, Copies of the books, Patrons, Checkouts when creating ERD diagram, the notation must be in crows notation, attached at the bottom is an example of crows foot notation in databases so you can understand. PDF...

  • this is about databases and SQL, please help me with this and i promise i will...

    this is about databases and SQL, please help me with this and i promise i will thumbs you up :) let me know if you need more info please try to get this done i will definitely thumbs you up :)) PROJECT TOPIC: Library: Books, Copies of the books, Patrons, Checkouts when creating ERD diagram, the notation must be in crows notation, attached at the bottom is an example of crows foot notation in databases so you can understand. PDF...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT