- implement sum, count query