Complete the code to create a BEFORE INSERT trigger on table 'orders'.
CREATE TRIGGER before_insert_order
BEFORE [1] ON orders
FOR EACH ROW EXECUTE FUNCTION check_order();The trigger must fire before an INSERT operation, so the correct event is INSERT.
Complete the code to specify the trigger timing as AFTER.
CREATE TRIGGER after_update_customer
[1] UPDATE ON customers
FOR EACH ROW EXECUTE FUNCTION log_update();The trigger should execute after the UPDATE operation, so the timing is AFTER.
Fix the error in the trigger creation by choosing the correct trigger event.
CREATE TRIGGER trg_delete_product
BEFORE [1] ON products
FOR EACH ROW EXECUTE FUNCTION archive_product();The trigger is named 'trg_delete_product' and should fire before a DELETE operation, so the event must be DELETE.
Fill both blanks to create a trigger that fires BEFORE UPDATE or DELETE on the 'employees' table.
CREATE TRIGGER trg_before_change BEFORE [1] OR [2] ON employees FOR EACH ROW EXECUTE FUNCTION validate_change();
The trigger fires before UPDATE or DELETE events, so the blanks must be UPDATE and DELETE.
Fill all three blanks to create a trigger that fires AFTER INSERT, UPDATE, or DELETE on 'sales'.
CREATE TRIGGER trg_after_change AFTER [1] OR [2] OR [3] ON sales FOR EACH ROW EXECUTE FUNCTION audit_changes();
The trigger fires after INSERT, UPDATE, or DELETE events, so the blanks must be INSERT, UPDATE, and DELETE.