Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Procedures: Create a procedure named AnimalCategorySales which takes cust _ id as the input and returns category and breed of animals they purchased. Required: apply
Procedures:
Create a procedure named AnimalCategorySales which takes custid as the input and returns
category and breed of animals they purchased.
Required: apply if else condition that returns category and breed if customer's sales data exists.
If otherwise, return an error message showing "Customer has not purchased an animal".
Note, for your input variable, name it custid something different than PetCustomerID and it
should be a data type of INT
Test it out by typing: Call AnimalCategorySales; you should get rows back.
Try it again with Call AnimalCategorySales; and you should get your error message from
above.
Type the command "show create procedure AnimalCategorySales" and screenshot the first
three columns of the output of this command Procedure sqlmode, Create Procedure
Also copy and paste your procedure code.
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