Use the my_guitar_shop database. Write a script that creates and calls a stored procedure named test.

Exercise in MySQL.

Use the my_guitar_shop database to do the following:

Start with the program on slide 11 in the Chapter 13 Power Point.

Make sure you can run the program as is.

Clean up any squiggly red lines. There are bad characters.

You will need to call the procedure test as in slide 4.

Hint: copy the USE and DROP from slide 3.

Change the delimiter back to”;”.

Change the procedure for my_guitar_shop as instructed below.

Write a script that creates and calls a stored procedure named test.

This stored procedure should use two variables to store (1) the count of all of the products in the Products table and (2) the average list price for those products. If the product count is greater than or equal to 7, the stored procedure should display a result set that displays the values of both variables. Otherwise, the procedure should display a result set that displays a message that says, “The number of products is less than 7”.

Make sure to test both outcomes. Hint: change the comparison operator to test.

Follow syntax instructions: Statement and clauses are in all caps (anything in blue). Files and columns are in lower case. Indent continuing statements

Use the my_guitar_shop database. Write a script that creates and calls a stored procedure named test.
Scroll to top