From the course: MySQL Database Administration
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Solution: Stored procedures - MySQL Tutorial
From the course: MySQL Database Administration
Solution: Stored procedures
- [Instructor] All right, this is the solution video for your assignment on stored procedures. As a reminder, Joe wants you to take this query shown on the right and bake it into a stored procedure so he can just run the simple call command. Let's jump into workbench and walk through the solution. Alright, so for this assignment we'll be using the Sloppy Joe's schema. And first thing, I just want to show you this call statement, which this is what Joe wants us to use in the end. So I'm going to run that. And you see down here at the bottom we get this error code, procedure Sloppy Joe's SP staff order served does not exist. So just showing you that we haven't created that yet. And by the end of this solution video, we will create this and that's what Joe wants. So this is the query that we want to embed in the stored procedure. I'll ditch this comment. And first let me show you the create procedure. And we're just going to take this name here and put that there. And then we say begin…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Creating an index4m 41s
-
(Locked)
The UNIQUE constraint4m 8s
-
(Locked)
The NOT NULL constraint3m 59s
-
(Locked)
Challenge: Indexes and constraints1m 12s
-
(Locked)
Solution: Indexes and constraints9m 24s
-
(Locked)
Stored procedures6m 27s
-
(Locked)
Challenge: Stored procedures2m 3s
-
(Locked)
Solution: Stored procedures4m 23s
-
(Locked)
Triggers7m 50s
-
(Locked)
Challenge: Triggers1m 41s
-
(Locked)
Solution: Triggers5m 8s
-
(Locked)
-
-