sub avg_a { # called on insert, update of table foo # check if average(a) > 100 }