Syntax:
[begin_label:] BEGIN
    [statement_list]
END [end_label]

BEGIN ... END syntax is used for writing compound statements, which can
appear within stored programs. A compound statement can contain
multiple statements, enclosed by the BEGIN and END keywords.
statement_list represents a list of one or more statements, each
terminated by a semicolon (;) statement delimiter. statement_list is
optional, which means that the empty compound statement (BEGIN END) is
legal.

Use of multiple statements requires that a client is able to send
statement strings containing the ; statement delimiter. This is handled
in the mysql command-line client with the delimiter command. Changing
the ; end-of-statement delimiter (for example, to //) allows ; to be
used in a program body. For an example, see
http://dev.mysql.com/doc/refman/5.1/en/stored-programs-defining.html.

A compound statement can be labeled. end_label cannot be given unless
begin_label also is present. If both are present, they must be the
same.

URL: http://dev.mysql.com/doc/refman/5.1/en/begin-end.html

