CREATE OR REPLACE TRIGGER emp_comm_trig 
 BEFORE INSERT ON emp 
 FOR EACH ROW 
BEGIN 
 IF :NEW.deptno = 30 THEN 
 :NEW.comm := :NEW.sal * 0.4; 
 END IF; 
END; 