I searched on the Internet how to use "before starting" in sqlite. I correctly know about use "after the trigger". I found one that said โbefore triggerโ was used to check before any changes made to the database (insert / updat line in the table). To clear the expression, I wrote a trigger in which the type is before and the event inserts to check the label before insertion. My trigger
create trigger mark_insert before insert on exam when mark<=50 begin insert into exam(mark) values(50); end;
Perhaps this is the wrong trigger. So, could you please point out errors to me? I want to check the mark that is less than or equal to 50. If so, I want to insert a default value (in this case 50). I am not very familiar with sql and trigger and am starting to learn.
My exam table has the following columns,
id(pk) | subject | mark
source share