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

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…

Contents