Here\'s the problem:
Create a trigger that prevents any change to the taking relation that would drop the overall average grade in any particular class below 2.5. No
I had the same issue and I noticed that if you do a select on the same table you put the trigger on you may/will get this problem. You can remove FOR EACH ROW or use the data in :New to do the calculation (if possible) and then make the update.
In your case it will make more sense to use separate table to have the avg_grade per semester.