Syntax:
CREATE
    [DEFINER = { user | CURRENT_USER }]
    TRIGGER trigger_name trigger_time trigger_event
    ON tbl_name FOR EACH ROW trigger_stmt

This statement creates a new trigger. A trigger is a named database
object that is associated with a table, and that activates when a
particular event occurs for the table. CREATE TRIGGER was added in
MySQL 5.0.2. Currently, its use requires the SUPER privilege.

The trigger becomes associated with the table named tbl_name, which
must refer to a permanent table. You cannot associate a trigger with a
TEMPORARY table or a view.

When the trigger is activated, the DEFINER clause determines the
privileges that apply, as described later in this section.

trigger_time is the trigger action time. It can be BEFORE or AFTER to
indicate that the trigger activates before or after the statement that
activated it.

trigger_event indicates the kind of statement that activates the
trigger. The trigger_event can be one of the following:

o INSERT: The trigger is activated whenever a new row is inserted into
  the table; for example, through INSERT, LOAD DATA, and REPLACE
  statements.

o UPDATE: The trigger is activated whenever a row is modified; for
  example, through UPDATE statements.

o DELETE: The trigger is activated whenever a row is deleted from the
  table; for example, through DELETE and REPLACE statements. However,
  DROP TABLE and TRUNCATE statements on the table do not activate this
  trigger, because they do not use DELETE. See [truncate].
