create or replace trigger befoerderung
after update on hoeren
declare
begin
UPDATE professoren SET rang = 'C4'
WHERE persnr in
  (SELECT persnr
   FROM professoren, vorlesungen v, hoeren h
   WHERE persnr = v.gelesenvon
   and v.vorlnr = h.vorlnr
   GROUP BY persnr
   having count(*) > 10);
end;