Creates function
full_name
that concatenates the two parameters and returns the result
DROP FUNCTION IF EXISTS full_name;

CREATE FUNCTION full_name ( first_name VARCHAR(100), last_name VARCHAR(100) )
RETURNS VARCHAR(210)
RETURN CONCAT(first_name, ' ', last_name);
After creating the function we can call it:
SELECT 
    full_name('John', 'Swift');
by Valeri Tandilashvili
4 years ago
MySQL
User defined functions
Full MySQL Course for Beginners
1
Pro tip: use ```triple backticks around text``` to write in code fences