Don't cut my salary

Report a typo

I'm Alex and my id = 4.

I want to create TRIGGER that doesn't allow cut my salary if anyone wants toUPDATE it.

Help me to sort it in the right order.

Put the items in the correct order
CREATE TRIGGER not_cut_salary
AND OLD.id = 4
AND NEW.salary < OLD.salary
FOR EACH ROW
BEFORE UPDATE ON employee
THEN
IF OLD.name = 'Alex'
SET NEW.salary = OLD.salary;
END IF;
___

Create a free account to access the full topic