create or replace trigger stu_trig
after delete or insert or UPDATE on tb_student
declare
age number;
cnt number;
begin
if inserting then
select min(TRUNC(months_between(sysdate, birthday)/12)) into age from tb_student;
dbms_output.put_line(age);
elsif deleting then
select count(*) into cnt from tb_student;
dbms_output.put_line(cnt);
elsif updating then
select avg(TRUNC(months_between(sysdate, birthday)/12)) into age from tb_student;
dbms_output.put_line(age);
end if;
end stu_trig;