1) CREATE TRIGGER majnb_log1 AFTER INSERT ON installer FOR EACH ROW BEGIN UPDATE POSTE SET NB_LOG = NB_LOG + 1 WHERE N_POSTE = :NEW.N_POSTE; UPDATE LOGICIEL SET NB_INSTALL = NB_INSTALL + 1 WHERE N_LOG = :NEW.N_LOG; END; / CREATE TRIGGER majnb_log2 AFTER DELETE ON installer FOR EACH ROW BEGIN UPDATE POSTE SET NB_LOG = NB_LOG - 1 WHERE N_POSTE = :OLD.N_POSTE; UPDATE LOGICIEL SET NB_INSTALL = NB_INSTALL - 1 WHERE N_LOG = :OLD.N_LOG; END; / update poste set NB_LOG='0' where N_POSTE='p1'; update poste set NB_LOG='2' where N_POSTE='p2'; update poste set NB_LOG='0' where N_POSTE='p3'; update poste set NB_LOG='1' where N_POSTE='p4'; update poste set NB_LOG='0' where N_POSTE='p5'; update poste set NB_LOG='2' where N_POSTE='p6'; update poste set NB_LOG='0' where N_POSTE='p7'; update poste set NB_LOG='2' where N_POSTE='p8'; update poste set NB_LOG='0' where N_POSTE='p9'; update poste set NB_LOG='1' where N_POSTE='p10'; update poste set NB_LOG='2' where N_POSTE='p11'; update poste set NB_LOG='1' where N_POSTE='p12'; 2) CREATE TRIGGER majposte AFTER INSERT ON poste FOR EACH ROW BEGIN UPDATE SALLE set NB_POSTE = NB_POSTE + 1 WHERE N_SALLE = :NEW.N_SALLE; END; / CREATE TRIGGER majposte2 AFTER DELETE ON poste FOR EACH ROW BEGIN UPDATE SALLE set NB_POSTE = NB_POSTE - 1 WHERE N_SALLE = :OLD.N_SALLE; END; / update segment set NB_SALLE='3' where N_SEGMENT='130.120.80'; update segment set NB_SALLE='2' where N_SEGMENT='130.120.81'; update segment set NB_SALLE='1' where N_SEGMENT='130.120.82'; update segment set NB_POSTE='7' where N_SEGMENT='130.120.80'; update segment set NB_POSTE='3' where N_SEGMENT='130.120.81'; update segment set NB_POSTE='2' where N_SEGMENT='130.120.82'; CREATE TRIGGER salle1 AFTER INSERT on salle FOR EACH ROW BEGIN UPDATE segment set nb_poste=nb_poste + 1 where n_segment=:NEW.n_segment; END; / CREATE TRIGGER salle2 AFTER DELETE on salle FOR EACH ROW BEGIN UPDATE segment set nb_poste=nb_poste - 1 where n_segment=:OLD.n_segment; END; / CREATE OR REPLACE TRIGGER salle3 after update of nb_poste on salle for each row begin update segment set nb_poste=nb_poste+:NEW.nb_poste-:OLD.nb_poste where n_segment = :OLD.n_segment; end ; /