Stored procedures are essentially functions that you can create in the database and reuse. What's neat about them from a usability standpoint is that they can take input parameters and then return a result.
Creating Stored Procedures
Stored procedures are created with the CREATE PROCEDURE statement. The syntax is shown below.
Syntax
CREATE PROCEDURE procedure_name@param data_type = default_value,