The BEFORE or AFTER keyword determines when the trigger actions will be executed relative to the insertion, modification or removal of the associated row.
An ON CONFLICT clause may be specified as part of an UPDATE or INSERT action within the body of the trigger.
You can create trigger using the CREATE TRIGGER statement.
If trigger activated, implicitly fire DML statement and if trigger deactivated can't fire.
Let get connected to get to know each other more....
The CREATE TRIGGER statement is used to add triggers to the database schema.
Triggers are database operations that are automatically performed when a specified database event occurs.
A trigger may be specified to fire whenever a DELETE, INSERT, or UPDATE of a particular database table occurs, or whenever an UPDATE occurs on on one or more specified columns of a table.
Hence explicitly specifying FOR EACH ROW is optional.
FOR EACH ROW implies that the SQL statements specified in the trigger may be executed (depending on the WHEN clause) for each database row being inserted, updated or deleted by the statement causing the trigger to fire.
Both the WHEN clause and the trigger actions may access elements of the row being inserted, deleted or updated using references of the form "NEW.column-name" and "OLD.column-name", where column-name is the name of a column from the table that the trigger is associated with.
OLD and NEW references may only be used in triggers on events for which they are relevant, as follows: If a WHEN clause is supplied, the SQL statements specified are only executed for rows for which the WHEN clause is true.
If no WHEN clause is supplied, the SQL statements are executed for all rows.