Postgres Select Count Statement Python Interview