what is the difference between stored procedure and function in mysql?
Stored procedure always returns an integer value of zero by default. Whereas function return types could be scalar or table or table values. Stored procedures have a precompiled execution plan, where as functions are not. ... A Function can be used in the SQL queries while a procedure cannot be used in SQL queries.