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.
Stored procedures - MySQL Tutorial
From the course: MySQL Database Administration
Stored procedures
- [Instructor] All right, so next, we're going to talk about stored procedures. MySQL gives us the ability to store and call frequently used queries on the server. These are often referred to as procedures, or more commonly, stored procedures. Some of the benefits for a stored procedure include more efficient query writing and query performance by being stored on the server and the ability to share complex procedures more easily between analysts and other database users. Because this is a beginner course, I'm not going to go crazy and write really complex SQL queries. I'm going to use a very simple example, just a select star and then the assignment, we're going to use a pretty simple group by. But assume there was a really, really long query and a lot of different people in an organization needed to use it over and over again. You could very easily take that query and save it as a stored procedure and then people can just call that stored procedure with a very simple line of code…
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)
-
-