Answered step by step
Verified Expert Solution
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 : List the item ID as ITEMID and description as ITEMDESC for all items. The descriptions should appear in uppercase letters.
Task : 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 : List the customer ID first and last names, and balance for all customers. The balance should be rounded to the nearest dollar.
Task : KimTay Pet Supplies is running a promotion that is valid for up to days after an order is placed. List the INVOICENUM, CUSTID FIRSTNAME, LASTNAME, INVOICEDATE, and the promotion date for each invoice as PROMOTIONDATE. The promotion date is days after the INVOICEDATE was placed.
Use the DATEADD function to add a date interval to the invoice date that uses the following syntax: DATEADDdate, INTERVAL value DAY
Task : Create the GETCREDITLIMIT procedure to obtain the full name and credit limit of the customer whose ID currently is stored in ICUSTID Place these values in the variables ICUSTOMERNAME and ICREDITLIMIT, respectively. When the procedure is called it should output the contents of ICUSTOMERNAME and ICREDITLIMIT.
Task : Create the GETINVOICEDATE 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 IINVOICENUM. Place these values in the variables ICUSTID ICUSTNAME, and IINVOICEDATE respectively. When the procedure is called it should output the contents of ICUSTID ICUSTNAME, and IINVOICEDATE.
Task : Create the ADDINVOICE procedure to add rows to the INVOICE table.
Task : Create the UPDATEINVOICE procedure to change the date of the invoice whose number is stored in IINVOICENUM to the date currently found in IINVOICEDATE.
Task : Create the DELETEINVOICE procedure to delete the invoice whose number is stored in IINVOICENUM.
Task : Create the ADDCOMMISSIONTRIG 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 : Create the UPDCOMMISSIONTRIG 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 : Create the DELCOMMISSIONTRIG trigger to subtract the balance multiplied by the sales reps commission rate from the commission for the corresponding sales rep when deleting a customer.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started