Complete the code to create a row-level trigger that fires for each row inserted.
CREATE TRIGGER trg_example
AFTER INSERT ON employees
FOR EACH [1]
EXECUTE FUNCTION log_employee_insert();The FOR EACH ROW clause makes the trigger fire once for every row affected.
Complete the code to create a statement-level trigger that fires once per statement.
CREATE TRIGGER trg_example
BEFORE UPDATE ON orders
FOR EACH [1]
EXECUTE FUNCTION check_order_status();The FOR EACH STATEMENT clause makes the trigger fire once per SQL statement.
Fix the error in the trigger creation by choosing the correct timing keyword.
CREATE TRIGGER trg_update
[1] UPDATE ON products
FOR EACH ROW
EXECUTE FUNCTION update_timestamp();Triggers must use BEFORE or AFTER to specify timing. DURING is invalid.
Fill both blanks to create a trigger that fires once per statement before delete.
CREATE TRIGGER trg_cleanup [1] DELETE ON sessions FOR EACH [2] EXECUTE FUNCTION cleanup_sessions();
The trigger fires BEFORE the delete statement and once per STATEMENT.
Fill all three blanks to create a row-level trigger that fires after insert.
CREATE TRIGGER trg_audit [1] [2] ON employees FOR EACH [3] EXECUTE FUNCTION audit_changes();
The trigger fires AFTER INSERT on each ROW.
