CREATE TABLE "cities_and_towns" (
  "rank" real,
  "city_town" text,
  "county" text,
  "region_province" text,
  "population" real,
  "country" text
);

Question: When birkenhead is the city/town and merseyside is the county and england is the country how many ranks are there?
SQL: SELECT COUNT("rank") FROM "cities_and_towns" WHERE "country"='England' AND "county"='Merseyside' AND "city_town"='Birkenhead';

Question: When 2 is the rank what is the city/town?
SQL: SELECT "city_town" FROM "cities_and_towns" WHERE "rank"=2;

Question: When 20 is the rank and north west is the region/province what is the county?
SQL: SELECT "county" FROM "cities_and_towns" WHERE "region_province"='North West' AND "rank"=20;

Question: When fleetwood is the city/town how many sets of population are there?
SQL: SELECT COUNT("population") FROM "cities_and_towns" WHERE "city_town"='Fleetwood';

Question: When 142900 is the population what is the highest rank?
SQL: SELECT MAX("rank") FROM "cities_and_towns" WHERE "population"=142900;

Question: When 31901 is the population what is the county?
SQL: SELECT "county" FROM "cities_and_towns" WHERE "population"=31901;