A stored function is a block of code similar to a stored procedure that performs operations and returns a single value to the user. Stored functions are defined using CREATE FUNCTION syntax that specifies the function name, parameters, return type, and BEGIN-END block containing the code and optional RETURN statement. For example, a stored function called F1 is defined to return the cube of an integer parameter by multiplying the parameter by itself twice and returning the result.