Deleting Stored Routines
Finally, before we end this chapter, let’s talk about deleting stored routines.
While MySQL allows us to alter our stored routines (using the ALTER keyword), we can only make very limited modifications to it.
Hence, if we need to edit our stored routines, the easier way is actually to delete and recreate them.
To delete a stored procedure, we write
DROP PROCEDURE [IF EXISTS] name_of_procedure;
To delete a stored function, we write
DROP FUNCTION [IF EXISTS] name_of_function;
For instance, to delete the calculateBonus function, we write
DROP FUNCTION IF EXISTS calculateBonus;