Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using the My Guitar Shop database you installed in Module 1 , develop the following queries. Write a script that creates and calls a stored
Using the My Guitar Shop database you installed in Module develop the following queries.
Write a script that creates and calls a stored procedure named insertcategory.
First, code a statement that creates a procedure that adds a new row to the Categories table. To do that, this procedure should have one parameter for the category name.
Code at least two CALL statements that test this procedure. Note that this table doesnt allow duplicate category names. Execute the query and take a screenshot of the query and the results.
Write a script that creates and calls a stored function named discountprice that calculates the discount price of an item in the OrderItems table discount amount subtracted from item price To do that, this function should accept one parameter for the item ID and it should return the value of the discount price for that item. Execute the query and take a screenshot of the query and the results.
Write a script that creates and calls a stored function named itemtotal that calculates the total amount of an item in the OrderItems table discount price multiplied by quantity To do that, this function should accept one parameter for the item ID it should use the discountprice function that you created in exercise and it should return the value of the total for that item. Execute the query and take a screenshot of the query and the results.
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