begin
if old.sign=0 and new.sign=1 then
update staff
set score=score+
(select credit
from course
where c_id=new.c_id),money=money-
(select schooling
from course
where c_id=new.c_id)
where account=new.account;
else
update staff
set score=score-
(select credit
from course
where c_id=new.c_id),money=money+
(select schooling
from course
where c_id=new.c_id)
where account=new.account;
end if;
end
if old.sign=0 and new.sign=1 then
update staff
set score=score+
(select credit
from course
where c_id=new.c_id),money=money-
(select schooling
from course
where c_id=new.c_id)
where account=new.account;
else
update staff
set score=score-
(select credit
from course
where c_id=new.c_id),money=money+
(select schooling
from course
where c_id=new.c_id)
where account=new.account;
end if;
end