Starting from:

$30

IT2351-Assignment 6 Solved

1.      Write a script that creates and calls a stored procedure named productCount. This stored procedure should declare a variable and set it to the count of all products in the products table. If the count is greater than or equal to 20, the stored procedure should display a message that says, “The number of products is greater than or equal to 20”. Otherwise, it should say, “The number of products is less than  

20”.   

   

2.      Write a script that creates and calls a stored procedure named insertCategory. This procedure should attempt to insert a new category named “Guitars” into the Categories table. If the insert is successful, the procedure should display this message: 1 row was inserted. If the update is unsuccessful, the procedure should display this message: Row was not inserted - duplicate entry.

   

Take a screenshot of both a successful (use a unique category name that you pick) – Assignmnet6No2Success and unsuccessful –   Assignment6No2Failed attempt at an insert.   

   

3.      Write a script that creates and calls a stored function named discount_price that calculates the discount price of an item in the order_items table (discount amount subtracted from item price). To do this, this function should accept one parameter for the item ID, and it should return the value of the discount price for that item 

 

4.      Either code or explain what you would need to do to create an EVENT that would run once a year to determine products that have not been ordered during the year..

More products