I have created a basic trigger that checks if the the new value inserted into a row is greater or equal than 1 and less or equal than 10 , this is for just test qualifications , the thing is that wherever I just insert a new test qualification for example 0 it adds it up to the table, but my trigger checks that this value should be greater than 0 and is not working
Trigger that checks if a qualification is greater or equal than 1 or less or equal than 10
delimiter //
CREATE TRIGGER checkQlfy BEFORE
INSERT ON qualify
FOR EACH ROW
BEGIN
IF new.qualify_pp >= 1 and new.qualify_pp <= 10 THEN
INSERT INTO qualify(qualify_pp) VALUES (new.qualify_pp);
END IF;
END//
delimiter ;
Now, this trigger is created succefully but wherever I insert a new value lets say with this line
INSERT INTO qualify(qualify_pp) VALUES(0);
It is inserted into the table, but I have said in the trigger that values greater or equal than 1 should be added.
I dont know why is this happening.