Add aggregate and group by to Python SQLHelper.