Answered step by step
Verified Expert Solution
Link Copied!

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 cust_id 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 cust_id something different than PetCustomerID and it
should be a data type of INT
Test it out by typing: Call AnimalCategorySales(9); you should get 2 rows back.
Try it again with Call AnimalCategorySales(13); 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, sql_mode, Create Procedure)
**Also, copy and paste your procedure code.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

Students also viewed these Databases questions