Suppose you have created the following table with values:
CREATE TABLE employee (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(20), salary DECIMAL(15,2));
INSERT INTO employee (name, salary) VALUES ('Benedict', 1500.00);
And also two triggers:
CREATE TRIGGER set_salary
BEFORE UPDATE ON employee
FOR EACH ROW
SET NEW.salary = 3000;
CREATE TRIGGER correct_salary
BEFORE UPDATE
ON employee
FOR EACH ROW
SET NEW.salary = IF(NEW.salary > 2000, 0, NEW.salary);
Write a correct trigger that will set salary equal to 1500 after each attempt to update any employee.