Abort delete

Report a typo

Hello, my name is Benedict and I am the owner of the company. Some prankster recently fired me, please create a trigger to prevent this from happening again.

Sort the code lines in the right order.

Put the items in the correct order
CREATE TRIGGER check_owner
IF OLD.id = 1
FOR EACH ROW
BEFORE DELETE ON employee
AND OLD.name = 'Benedict' THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'I am owner for this company. You can't delete me!';
END IF;
___

Create a free account to access the full topic