CREATE TRIGGER Statement Trigger names exist in the schema namespace, meaning that all triggers must have unique names within a schema. Triggers in different schemas can have the same name. This section describes  CREATE TRIGGER  syntax. For additional discussion, see Section 25.3.1, “Trigger Syntax and Examples” . CREATE TRIGGER  requires the  TRIGGER  privilege for the table associated with the trigger. If the  DEFINER clause is present, the privileges required depend on the  user  value, as discussed in Section 25.6, “Stored Object Access Control” . If binary logging is enabled,  CREATE TRIGGER  might require the  SUPER  privilege, as discussed in Section 25.7, “Stored Program Binary Logging” . The  DEFINER  clause determines the security context to be used when checking access privileges at trigger activation time, 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 each row to be modified. Basic column value checks occur prior to trigger activation, so you cannot use  BEFORE  triggers to convert values inappropriate for the column type to valid values. trigger_event  indicates the kind of operation that activates the trigger. These  trigger_event  values are permitted: The  trigger_event  does not represent a literal type of SQL statement that activates the trigger so much as it represents a type of table operation. For example, an  INSERT  trigger activates not only for  INSERT statements but also  LOAD DATA  statements because both statements insert rows into a table. A potentially confusing example of this is the  INSERT INTO ... ON DUPLICATE KEY UPDATE ... syntax: a  BEFORE INSERT  trigger activates for every row, followed by either an  AFTER INSERT  trigger or both the  BEFORE UPDATE  and  AFTER UPDATE  triggers, depending on whether there was a duplicate key for the row. Cascaded foreign key actions do not activate triggers. It is possible to define multiple triggers for a given table that have the same trigger event and action time. For example, you can have two  BEFORE UPDATE  triggers for a table. By default, triggers that have the same trigger event and action time activate in the order they were created. To affect trigger order, specify a  trigger_order  clause that indicates  FOLLOWS  or  PRECEDES  and the name of an existing trigger that also has the same trigger event and action time. With  FOLLOWS , the new trigger activates after the existing trigger. With  PRECEDES , the new trigger activates before the existing trigger. trigger_body  is the statement to execute when the trigger activates. To execute multiple statements, use the  BEGIN ... END  compound statement construct. This also enables you to use the same statements that are permitted within stored routines. See Section 13.6.1, “BEGIN ... END Compound 2605 Note • INSERT : The trigger activates whenever a new row is inserted into the table (for example, through INSERT ,  LOAD DATA , and  REPLACE  statements). • UPDATE : The trigger activates whenever a row is modified (for example, through  UPDATE  statements). • DELETE : The trigger activates whenever a row is deleted from the table (for example, through  DELETE and  REPLACE  statements).  DROP TABLE  and  TRUNCATE TABLE  statements on the table do  not  activate this trigger, because they do not use  DELETE . Dropping a partition does not activate  DELETE  triggers, either.