Stored Procedure vs Function in MySQL

* Stored Procedures are pre-compile objects which are compiled for first time and its compiled format is saved which executes whenever it is called. But Function is compiled and executed every time when it is called.
Stored

* Procedures are used as scripts and functions are used as methods

* Functions have a scalar return value. Procedures do not have a return value.

* A stored procedure may have arguments that are IN, OUT, or INOUT. Functions may only have IN arguments.

* To invoke a stored procedure, use the CALL statement. To invoke a stored function, refer to it in an expression