update activities sum and count for sqlite db