MySQL supports several types of objects that are stored on the server side for later use. Some are invoked on demand; others execute automatically when table modifications occur or when a scheduled time is reached:
Stored functions return a result from a calculation and can be used in expressions.
Stored procedures do not return a result directly but can be used to perform general computations or produce result sets that are passed back to the client.
Triggers are associated with a table and are defined to execute when the table is modified via
Events execute on a time-activated basis according to a schedule.
MySQL added support for stored functions and procedures in version 5.0.0, triggers ...