Question: Chapter 8 ( A Guide to SQL ) Use the KimTay Pet Supplies database only. You must use Oracle. Case Exercises: Odd numbers, pg .
Chapter A Guide to SQL Use the KimTay Pet Supplies database only. You must use Oracle.
Case Exercises: Odd numbers, pg
KimTay Pet Supplies
Use the KimTay Pet Supplies database see Figure in Module to complete the following
exercises. If directed to do so by your instructor, use the information provided with the Module
Exercises to print your output or save it to a file.
List the item ID and description for all items. The descriptions should appear in uppercase letters.
List the customer ID and first and last names for all customers located in the city of Cody. Your query should ignore case. For example, a customer with the city Cody should be included, as should customers whose city is CODY, cody, cOdY, and so on
List the customer ID first and last names, and balance for all customers. The balance should be rounded to the nearest dollar.
KimTay Pet Supplies is running a promotion that is valid for up to days after an order is placed. List the invoice number, customer ID customer first and last names, and the promotion date for each invoice. The promotion date is days after the invoice was placed.
Write MySQL PLSQL or TSQL procedures to accomplish the following tasks:
a Obtain the name and credit limit of the customer whose ID currently is stored in ICUSTID Place these values in the variables ICUSTOMERNAME and ICREDITLIMIT, respectively. Output the contents of ICUSTOMERNAME and ICREDITLIMIT.
b Obtain the invoice date, customer ID and first and last names for the invoice whose number currently is stored in IINVOICENUM. Place these values in the variables IINVOICEDATE, ICUSTID and ICUSTNAME, respectively. Output the contents of IINVOICEDATE, ICUSTID and ICUSTNAME.
c Add a row to the INVOICE table.
d Change the date of the invoice whose number is stored in IINVOICENUM to the date currently found in IINVOICEDATE.
e Delete the invoice whose number is stored in IINVOICENUM.
Write MySQL PLSQL or TSQL procedures to retrieve and output the item ID description, location, and price of every item in the category stored in ICATEGORY.
Write a stored procedure in MySQL PLSQL or TSQL that changes the price of an item with a given item ID How would you use this stored procedure to change the price of item
AD to $
Write the code for the following triggers in MySQL PLSQL or TSQL following the style shown in the text.
a When adding a customer, add the customers balance multiplied by the sales reps commission rate to the commission for the corresponding sales rep.
b When updating a customer, add the difference between the new balance and the old balance multiplied by the sales reps commission rate to the commission for the corresponding sales rep.
c When deleting a customer, subtract the balance multiplied by the sales reps commission rate from the commission for the corresponding sales rep.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
