Table: cities_population_history
Columns: rank
city
province
date_of_official_foundation_of_municipality
2006
1996
1986
1976
1966
1956

Question: What is the 2006 sum with a rank 1 and more than 6758845 in 1996?
SQL: SELECT SUM("2006") FROM cities_population_history WHERE "rank" = 1 AND "1996" > 6758845

Question: What is the total number in 2006, which has an official foundation of municipality of 1918?
SQL: SELECT COUNT("2006") FROM cities_population_history WHERE "date_of_official_foundation_of_municipality" = 1918

Question: What is teh average rank of the city of mashhad, which had less than 667770 in 1976?
SQL: SELECT AVG("rank") FROM cities_population_history WHERE "city" = 'mashhad' AND "1976" < 667770

Question: What is the average rank of the province alborz, which had more than 14526 in 1956?
SQL: SELECT AVG("rank") FROM cities_population_history WHERE "province" = 'alborz' AND "1956" > 14526