CREATE TABLE "historical_data" (
  "rank" text,
  "province" text,
  "population_2011" real,
  "area_km" real,
  "density_per_km" real
);

Question: what is the least density (per km²) when the area (km²) is more than 129,825 and the rank is 3?
SQL: SELECT MIN("density_per_km") FROM "historical_data" WHERE "area_km">'129,825' AND "rank"='3';

Question: what is the  Density (per km²) when the Area (km²) is 372,889 and the population (2011) is 1,145,861?
SQL: SELECT SUM("density_per_km") FROM "historical_data" WHERE "area_km"='372,889' AND "population_2011">'1,145,861';

Question: what is the area (km²) when the rank is south africa and the population (2011) is more than 51,770,561?
SQL: SELECT AVG("area_km") FROM "historical_data" WHERE "rank"='south africa' AND "population_2011">'51,770,561';

Question: what is the least density (per km²) when the rank is 5 and the Area (km²) is less than 125,755?
SQL: SELECT MIN("density_per_km") FROM "historical_data" WHERE "rank"='5' AND "area_km"<'125,755';