Direction: Choose the correct option
Q1.
What is a trigger in SQL?
Direction: Choose the correct option
Q2.
CREATE TRIGGER validate_age BEFORE INSERT ON students FOR EACH ROW BEGIN IF NEW.age < 18 THEN SIGNAL SQLSTATE '45000'; END IF; END;When does this trigger fire?Direction: Choose the correct option
Q3.
CREATE TRIGGER after_emp_insert AFTER INSERT ON employees FOR EACH ROW INSERT INTO audit VALUES (NEW.id, 'INSERT', NOW());What does this trigger do?Direction: Choose the correct option
Q4.
CREATE TRIGGER update_timestamp BEFORE UPDATE ON employees FOR EACH ROW SET NEW.last_modified = NOW();What is NEW referring to?Direction: Choose the correct option
Q5.
How do you remove a trigger?
