Python Count Group By Sql Interview