Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1 : List the item ID as ITEM _ ID and description as ITEM _ DESC for all items. The descriptions should appear in

Task 1: List the item ID as ITEM_ID and description as ITEM_DESC for all items. The descriptions should appear in uppercase letters.
Task 2: 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.
Task 3: List the customer ID, first and last names, and balance for all customers. The balance should be rounded to the nearest dollar.
Task 4: KimTay Pet Supplies is running a promotion that is valid for up to 20 days after an order is placed. List the INVOICE_NUM, CUST_ID, FIRST_NAME, LAST_NAME, INVOICE_DATE, and the promotion date for each invoice as PROMOTION_DATE. The promotion date is 20 days after the INVOICE_DATE was placed.
Use the DATE_ADD function to add a date interval to the invoice date that uses the following syntax: DATEADD(_date, INTERVAL value DAY)
Task 5: Create the GET_CREDIT_LIMIT procedure to obtain the full name and credit limit of the customer whose ID currently is stored in I_CUST_ID. Place these values in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. When the procedure is called it should output the contents of I_CUSTOMER_NAME and I_CREDIT_LIMIT.
Task 6: Create the GET_INVOICE_DATE procedure to obtain the customer ID, first and last names of the customer, and the invoice date for the invoice whose number currently is stored in I_INVOICE_NUM. Place these values in the variables I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE respectively. When the procedure is called it should output the contents of I_CUST_ID, I_CUST_NAME, and I_INVOICE_DATE.
Task 7: Create the ADD_INVOICE procedure to add rows to the INVOICE table.
Task 8: Create the UPDATE_INVOICE procedure to change the date of the invoice whose number is stored in I_INVOICE_NUM to the date currently found in I_INVOICE_DATE.
Task 9: Create the DELETE_INVOICE procedure to delete the invoice whose number is stored in I_INVOICE_NUM.
Task 10: Create the ADD_COMMISSION_TRIG trigger to add the customers balance multiplied by the sales reps commission rate to the commission for the corresponding sales rep when adding a new customer.
Task 11: Create the UPD_COMMISSION_TRIG trigger to 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 when updating a customer.
Task 12: Create the DEL_COMMISSION_TRIG trigger to subtract the balance multiplied by the sales reps commission rate from the commission for the corresponding sales rep when deleting a customer.
image text in transcribed

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

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions