Chinastark/bird_dataset huggingface dataset:
Database: mondial_geo
Question: Among the countries with a population of over 10000000, how many of them have a GDP of over 500000?
SQL: SELECT count(country.name) FROM country INNER JOIN economy ON country.code = economy.country WHERE economy.gdp > 500000 AND country.population > 10000000
Database: mondial_geo
Question: Please list the capital cities of the countries with an inflation rate under 2.
SQL: SELECT country.capital FROM country INNER JOIN economy ON country.code = economy.country WHERE economy.inflation < 2
Database: mondial_geo
Question: Which country has the lowest inflation rate?
SQL: SELECT country.name FROM country INNER JOIN economy ON country.code = economy.country WHERE economy.inflation IS NOT NULL ORDER BY economy.inflation ASC LIMIT 1
Database: mondial_geo
Question: Among the countries whose agriculture percentage of the GDP is under 50%, how many of them have an area of over 8000000?
SQL: SELECT count(country.name) FROM country INNER JOIN economy ON country.code = economy.country WHERE economy.agriculture < 50 AND country.area > 8000000
Database: mondial_geo
Question: How many cities have a salt lake located in it?
SQL: SELECT count(located.city) FROM located INNER JOIN lake ON located.lake = lake.name WHERE lake.type = 'salt'
Database: mondial_geo
Question: Please list the depth of the lakes that are located in the Province of Albania.
SQL: SELECT lake.depth FROM located INNER JOIN lake ON located.lake = lake.name WHERE located.province = 'Albania'
Database: mondial_geo
Question: The lake with the highest altitude is located in which city?
SQL: SELECT located.city FROM lake LEFT JOIN located ON located.lake = lake.name ORDER BY lake.altitude DESC LIMIT 1
Database: mondial_geo
Question: How many lakes in the Canary Islands cover an area of over 1000000?
SQL: SELECT count(lake.name) FROM located INNER JOIN lake ON located.lake = lake.name WHERE located.province = 'Canary Islands' AND lake.area > 1000000
Database: mondial_geo
Question: Which country has the most languages spoken?
SQL: SELECT country.name FROM country INNER JOIN LANGUAGE ON country.code = LANGUAGE.country GROUP BY country.name ORDER BY count(LANGUAGE.name) DESC LIMIT 1
Database: mondial_geo
Note: percentage of country > 90% refers to percentage > 90; America is one of country names;
Question: What is the capital city of the country that has the percentage of Armenian speakers over 90%?
SQL: SELECT country.capital FROM country INNER JOIN LANGUAGE ON country.code = LANGUAGE.country WHERE LANGUAGE.name = 'Armenian' AND LANGUAGE.percentage > 90
Database: mondial_geo
Question: Among the countries with a population of under 1000000, how many of them have over 2 languages?
SQL: SELECT LANGUAGE.country FROM country INNER JOIN LANGUAGE ON country.code = LANGUAGE.country WHERE country.population < 1000000 GROUP BY LANGUAGE.country HAVING count(country.name) > 2
Database: mondial_geo
Question: How many organizations are founded in countries with a population of under 1000000?
SQL: SELECT count(organization.name) FROM country INNER JOIN organization ON country.code = organization.country WHERE country.population < 1000000
Database: mondial_geo
Question: How many organizations are established after 1999/1/1 in a country whose GDP is under 500000?
SQL: SELECT economy.country, count(economy.country) FROM economy INNER JOIN organization ON economy.country = organization.country WHERE economy.gdp < 500000 AND strftime('%Y', organization.established) < '1999' GROUP BY economy.country
Database: mondial_geo
Question: Among the countries with over 3 organizations, how many of them have an inflation rate of over 5%?
SQL: SELECT count(organization.country) FROM economy INNER JOIN organization ON economy.country = organization.country WHERE organization.country IN ( SELECT country FROM organization GROUP BY country HAVING count(country) > 3 ) AND economy.inflation > 5
Database: mondial_geo
Question: How many organizations are established in the country with the most ethnic groups?
SQL: SELECT count(organization.province) FROM country INNER JOIN organization ON country.code = organization.country INNER JOIN ethnicgroup ON ethnicgroup.country = organization.country GROUP BY country.name ORDER BY count(ethnicgroup.name) DESC LIMIT 1
Database: mondial_geo
Note: Dutch is one of language;
Question: Please list the organization names established in the countries where Dutch is spoken.
SQL: SELECT organization.name FROM LANGUAGE INNER JOIN organization ON LANGUAGE.country = organization.country WHERE LANGUAGE.name = 'Dutch'
Database: mondial_geo
Note: Bosnian is one of language;
Question: How many organizations are established in countries where people speak Bosnian?
SQL: SELECT count(organization.name) FROM LANGUAGE INNER JOIN organization ON LANGUAGE.country = organization.country WHERE LANGUAGE.name = 'Bosnian'
Database: mondial_geo
Question: What is the highest infant mortality rate per thousand of the countries whose inflation is under 3?
SQL: SELECT max(population.infant_mortality) FROM economy INNER JOIN population ON economy.country = population.country WHERE economy.inflation < 3
Database: mondial_geo
Note: population growth rate of over 3% means population_growth > 3;
Question: Among the countries whose GDP is over 1000000, how many of them have a population groth rate of over 3%?
SQL: SELECT count(economy.country) FROM economy INNER JOIN population ON economy.country = population.country WHERE economy.gdp > 1000000 AND population.population_growth > 3
Database: mondial_geo
Note: gdp per capita = gdp / population;
Question: Which country has the highest GDP per capita?
SQL: SELECT country.name FROM country INNER JOIN economy ON country.code = economy.country ORDER BY economy.gdp / country.population DESC LIMIT 1
Database: mondial_geo
Note: lake area coverage = [sum(area of the lakes in the country) / (area of the country)] * 100%;
Question: What is the highest lake area coverage of a country?
SQL: SELECT lake.area * 100  / country.area FROM located INNER JOIN lake ON located.lake = lake.name INNER JOIN country ON country.code = located.country ORDER BY lake.longitude DESC LIMIT 1
Database: mondial_geo
Question: What is the average population growth rate of countries where more than 3 languages are used?
SQL: SELECT sum(population.population_growth) / count(population.country) FROM country INNER JOIN LANGUAGE ON country.code = LANGUAGE.country INNER JOIN population ON population.country = LANGUAGE.country WHERE LANGUAGE.country IN ( SELECT country FROM LANGUAGE GROUP BY country HAVING count(country) > 3 ) GROUP BY population.country
Database: mondial_geo
Note: Average inflation rate = [sum(inflation) / count(countries)]; 30% above average implies inflation > 1.3 average inflation rate;
Question: Please list the names of the countries with an inflation rate that's 30% above the average.
SQL: SELECT country.name FROM country INNER JOIN economy ON country.code = economy.country GROUP BY country.name, economy.inflation HAVING economy.inflation > avg(economy.inflation) * 1.3
Database: mondial_geo
Note: Baghdad is one of provinces;
Question: Where country does Baghdad belongs to?
SQL: SELECT name FROM country WHERE province = 'Baghdad'
Database: mondial_geo
Question: Which religion has the largest population in Martinique?
SQL: SELECT religion.name FROM country INNER JOIN religion ON country.code = religion.country WHERE country.name = 'Martinique' ORDER BY country.population DESC LIMIT 1
Database: mondial_geo
Question: Which country is 41% Christian? Give the full name of the country.
SQL: SELECT country.name FROM country INNER JOIN religion ON country.code = religion.country WHERE religion.name = 'Christian' AND religion.percentage = 41
Database: mondial_geo
Question: Which two countries does the Detroit River flow through? Give the full name of the country.
SQL: SELECT country.name FROM located INNER JOIN river ON located.river = river.name INNER JOIN country ON country.code = located.country WHERE river.name = 'Detroit River'
Database: mondial_geo
Question: Which two countries have the longest border in the world? Give the full name of the country.
SQL: SELECT borders.country1, borders.country2 FROM country INNER JOIN borders ON country.code = borders.country1 ORDER BY borders.length DESC LIMIT 1
Database: mondial_geo
Question: Which country has the most neighbors? Give the full name of the country.
SQL: SELECT country.name FROM country INNER JOIN borders ON country.code = borders.country1 GROUP BY country.name ORDER BY count(country.name) DESC LIMIT 1
Database: mondial_geo
Question: Which country is Mountain Cerro Chirripo located in? Give the full name of the country.
SQL: SELECT DISTINCT country.name FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country WHERE geo_mountain.mountain = 'Cerro Chirripo'
Database: mondial_geo
Note: Indonesia refers to one of countries;
Question: How many mountains are there in Indonesia?
SQL: SELECT count(DISTINCT geo_mountain.mountain) FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country WHERE country.name = 'Indonesia'
Database: mondial_geo
Note: Japan is one of country names;
Question: What is the quantity of the mountains does Japan have?
SQL: SELECT count(DISTINCT geo_mountain.mountain) FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country WHERE country.name = 'Japan'
Database: mondial_geo
Question: What is the latitude of the island on which Mount Andrinjitra is located?
SQL: SELECT island.latitude FROM island INNER JOIN mountainonisland ON island.name = mountainonisland.island WHERE mountainonisland.mountain = 'Andringitra'
Database: mondial_geo
Question: Which two countries share the second highest mountain? Give the country code.
SQL: SELECT country.code FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country WHERE geo_mountain.mountain = ( SELECT name FROM mountain ORDER BY height DESC LIMIT 1, 1 )
Database: mondial_geo
Question: What is the area of Egypt as a percentage of Asia?
SQL: SELECT encompasses.percentage FROM country INNER JOIN encompasses ON country.code = encompasses.country INNER JOIN continent ON continent.name = encompasses.continent WHERE continent.name = 'Asia' AND country.name = 'Egypt'
Database: mondial_geo
Question: What is the area of Egypt as a percentage of Asia?
SQL: SELECT country.area * 100 / continent.area FROM country INNER JOIN encompasses ON country.code = encompasses.country INNER JOIN continent ON continent.name = encompasses.continent WHERE continent.name = 'Asia' AND country.name = 'Egypt'
Database: mondial_geo
Note: most people refers to largest population;
Question: Which city in Japan has the most people in the country?
SQL: SELECT city.name FROM country INNER JOIN city ON country.code = city.country WHERE country.name = 'Japan' ORDER BY city.population DESC LIMIT 1
Database: mondial_geo
Note: Olsztyn is one of country names;
Question: For the country in which Olsztyn is located, where is the capital?
SQL: SELECT country.capital FROM country INNER JOIN city ON country.code = city.country WHERE city.name = 'Olsztyn'
Database: mondial_geo
Question: In which province is the highest volcano mountain located in?
SQL: SELECT country.province FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country INNER JOIN mountain ON mountain.name = geo_mountain.mountain WHERE mountain.type = 'volcano' ORDER BY mountain.height DESC LIMIT 1
Database: mondial_geo
Note: Uganda is one of country names;
Question: When did Uganda declare independence?
SQL: SELECT politics.independence FROM country INNER JOIN politics ON country.code = politics.country WHERE country.name = 'Uganda'
Database: mondial_geo
Note: Uganda is one of country names;
Question: What kind of government does Iran have?
SQL: SELECT politics.government FROM country INNER JOIN politics ON country.code = politics.country WHERE country.name = 'Iran'
Database: mondial_geo
Note: Bermuda is one of countries;
Question: Where does Bermuda belong to? Give the full name of the country.
SQL: SELECT country.name FROM locatedon INNER JOIN island ON locatedon.island = island.name INNER JOIN country ON country.code = locatedon.country WHERE country.name = 'Bermuda'
Database: mondial_geo
Note: Malay is one of country names;
Question: Where is the capital of country which has the largest percentage of Malay people?
SQL: SELECT country.capital FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country WHERE ethnicgroup.name = 'Malay' ORDER BY ethnicgroup.percentage DESC LIMIT 1
Database: mondial_geo
Question: For the third largest country, which ethinic group has the most population?
SQL: SELECT ethnicgroup.name FROM country INNER JOIN ethnicgroup ON country.code = ethnicgroup.country WHERE country.name = ( SELECT name FROM country ORDER BY area DESC LIMIT 2, 1 ) GROUP BY ethnicgroup.name ORDER BY ethnicgroup.percentage * country.population DESC LIMIT 1
Database: mondial_geo
Question: Which country has the city of 114339 in population? Give the full name of the country.
SQL: SELECT country.name FROM country INNER JOIN city ON country.code = city.country WHERE city.population = 114339
Database: mondial_geo
Question: How many rivers finally flows to the sea of 459m in depth?
SQL: SELECT count(*) FROM river WHERE sea IN ( SELECT name FROM sea WHERE depth = 459 )
Database: mondial_geo
Question: What is the area of the country which became independent in 1921/3/13?
SQL: SELECT country.area FROM country INNER JOIN politics ON country.code = politics.country WHERE politics.independence = '1921-03-13'
Database: mondial_geo
Note: population density = population / area;
Question: What is the population density of the Petropavl's home country?
SQL: SELECT cast(country.population AS REAL) / country.area FROM country INNER JOIN city ON country.code = city.country WHERE city.name = 'Petropavl'
Database: mondial_geo
Note: English and Scottish are two languages; United Kingdom is a country;
Question: How many more people speak English than speak Scottish in United Kingdom?
SQL: SELECT country.population * (ethnicgroup.percentage - ethnicgroup.percentage) FROM ethnicgroup INNER JOIN ethnicgroup ON ethnicgroup.country = ethnicgroup.country INNER JOIN country ON ethnicgroup.country = country.code WHERE ethnicgroup.name = 'Scottish' AND ethnicgroup.name = 'English' AND country.name = 'United Kingdom'
Database: mondial_geo
Note: population density = population / area;
Question: What is the most populated city of the 12th highest density country?
SQL: SELECT city.name FROM country INNER JOIN city ON country.code = city.country WHERE country.name = ( SELECT name FROM country ORDER BY cast(population AS REAL) / area LIMIT 11, 1 ) ORDER BY city.population DESC LIMIT 1
Database: mondial_geo
Note: How many times longer = longest border / shortest border;
Question: How many times longer is the longest border in the United States than the shortest?
SQL: SELECT max(borders.length) / min(borders.length) FROM country INNER JOIN borders ON country.code = borders.country2 WHERE country.name = 'United States'
Database: mondial_geo
Question: Please list the capital cities of the countries that have more than 4 mountains.
SQL: SELECT country.capital FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country GROUP BY country.name, country.capital HAVING count(country.name) > 4
Database: mondial_geo
Question: How many mountains are there in the country with the greatest population?
SQL: SELECT count(geo_mountain.mountain) FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country GROUP BY country.name ORDER BY country.population DESC LIMIT 1
Database: mondial_geo
Question: Among the countries whose agriculture takes up more than 40% of its GDP, how many of them have less than 2 mountains?
SQL: SELECT count(t3.country) FROM ( SELECT economy.country FROM economy INNER JOIN geo_mountain ON economy.country = geo_mountain.country WHERE economy.industry < 40 GROUP BY economy.country HAVING count(economy.country) < 2 ) AS t3
Database: mondial_geo
Question: Please list the mountains in the country with the lowest inflation rate.
SQL: SELECT mountain FROM geo_mountain WHERE country = ( SELECT country FROM economy ORDER BY inflation ASC LIMIT 1 )
Database: mondial_geo
Question: Among the independent countries whose type of government is republic, what is the biggest number of deserts they have?
SQL: SELECT count(geo_desert.desert) FROM country INNER JOIN politics ON country.code = politics.country INNER JOIN geo_desert ON geo_desert.country = politics.country WHERE politics.government = 'republic'
Database: mondial_geo
Question: Please list the deserts in the countries whose population is over 100000 and covers an area of under 500000.
SQL: SELECT geo_desert.desert FROM country INNER JOIN geo_desert ON country.code = geo_desert.country WHERE country.area > 100000 AND country.population < 500000
Database: mondial_geo
Question: How many deserts are there in a country where over 90% of people speaks Armenian?
SQL: SELECT count(geo_desert.desert) FROM country INNER JOIN geo_desert ON country.code = geo_desert.country INNER JOIN LANGUAGE ON country.code = geo_desert.country WHERE LANGUAGE.name = 'Armenian' AND LANGUAGE.percentage > 90
Database: mondial_geo
Question: Which mountain is the highest in an independent country?
SQL: SELECT mountain.name FROM country INNER JOIN politics ON country.code = politics.country INNER JOIN geo_mountain ON geo_mountain.country = politics.country INNER JOIN mountain ON mountain.name = geo_mountain.mountain WHERE politics.independence IS NOT NULL ORDER BY mountain.height DESC LIMIT 1
Database: mondial_geo
Question: How many volcanic mountains are there in countries whose population is no more than 5000000?
SQL: SELECT count(DISTINCT mountain.name) FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country INNER JOIN mountain ON mountain.name = geo_mountain.mountain WHERE mountain.type = 'volcanic' AND country.population <= 5000000
Database: mondial_geo
Question: Among the countries with a GDP of over 1000000, how many of them have mountains higher than 1000?
SQL: SELECT count(DISTINCT country.name) FROM country INNER JOIN geo_mountain ON country.code = geo_mountain.country INNER JOIN economy ON economy.country = country.code INNER JOIN mountain ON mountain.name = geo_mountain.mountain WHERE economy.gdp > 1000000 AND mountain.height > 1000
Database: mondial_geo
Question: What is the greatest length of the border between 2 independent countries?
SQL: SELECT max(borders.length) FROM country INNER JOIN politics ON country.code = politics.country INNER JOIN borders ON borders.country1 = politics.country WHERE politics.independence IS NOT NULL
Database: mondial_geo
Question: Among the countries whose government type is republic, how many of them shares a border that's longer than 200?
SQL: SELECT count(DISTINCT country.name) FROM country INNER JOIN politics ON country.code = politics.country INNER JOIN borders ON borders.country1 = politics.country WHERE politics.government = 'republic' AND borders.length > 200
Database: mondial_geo
Question: Please list the countries that share the shortest border.
SQL: SELECT country.name FROM country INNER JOIN borders ON country.code = borders.country1 ORDER BY borders.length ASC LIMIT 1
Database: mondial_geo
Question: What is the GDP of the European Continent?
SQL: SELECT sum(economy.gdp) FROM country INNER JOIN encompasses ON country.code = encompasses.country INNER JOIN continent ON continent.name = encompasses.continent INNER JOIN economy ON economy.country = country.code WHERE continent.name = 'Europe'
Database: mondial_geo
Question: How many mountains are there on the African Continent?
SQL: SELECT count(continent.name) FROM country INNER JOIN encompasses ON country.code = encompasses.country INNER JOIN continent ON continent.name = encompasses.continent INNER JOIN province ON province.country = country.code INNER JOIN geo_mountain ON geo_mountain.province = province.name WHERE continent.name = 'European'
Database: mondial_geo
Question: Of the deserts on the America Continent, which one covers the greatest area?
SQL: SELECT desert.name FROM country INNER JOIN encompasses ON country.code = encompasses.country INNER JOIN continent ON continent.name = encompasses.continent INNER JOIN geo_desert ON geo_desert.country = country.code INNER JOIN desert ON desert.name = geo_desert.desert WHERE continent.name = 'America' ORDER BY desert.area DESC LIMIT 1
Database: mondial_geo
Question: Please list the countries on the European Continent that have a population growth of more than 3%.
SQL: SELECT encompasses.country FROM country INNER JOIN encompasses ON country.code = encompasses.country INNER JOIN continent ON continent.name = encompasses.continent INNER JOIN population ON population.country = country.code WHERE continent.name = 'Europe' AND population.population_growth > 0.03
Database: mondial_geo
Question: How many countries on the European Continent has an infant mortality rate per thousand of over 100?
SQL: SELECT count(country.name) FROM country INNER JOIN encompasses ON country.code = encompasses.country INNER JOIN continent ON continent.name = encompasses.continent INNER JOIN population ON population.country = country.code WHERE continent.name = 'Europe' AND population.infant_mortality < 100
Database: mondial_geo
Question: Among the countries that use Bosnian as their language, how many of them don't have a positive population growth rate?
SQL: SELECT count(DISTINCT country.name) FROM country INNER JOIN LANGUAGE ON country.code = LANGUAGE.country INNER JOIN population ON population.country = LANGUAGE.country WHERE LANGUAGE.name = 'Bosnian' AND population.population_growth < 0
Database: mondial_geo
Question: What is the average percentage of agriculture of GDP in countries on the African Continent?
SQL: SELECT avg(economy.agriculture) FROM continent INNER JOIN encompasses ON continent.name = encompasses.continent INNER JOIN country ON country.code = encompasses.country INNER JOIN economy ON economy.country = country.code WHERE continent.name = 'Africa'
Database: mondial_geo
Question: Among the independent countries, how many of them has a GDP per capita of over 5000?
SQL: SELECT count(DISTINCT country.name) FROM country INNER JOIN politics ON country.code = politics.country INNER JOIN economy ON economy.country = politics.country WHERE politics.independence IS NOT NULL AND economy.gdp > 5000
Database: mondial_geo
Question: What is the average inflation rate of the biggest continent?
SQL: SELECT avg(economy.inflation) FROM continent INNER JOIN encompasses ON continent.name = encompasses.continent INNER JOIN country ON country.code = encompasses.country INNER JOIN economy ON economy.country = country.code WHERE continent.name = ( SELECT name FROM continent ORDER BY area DESC LIMIT 1 )
Database: mondial_geo
Question: Which island is city Balikpapan located on? How big is the island?
SQL: SELECT island.name, island.area FROM city INNER JOIN locatedon ON city.name = locatedon.city INNER JOIN island ON island.name = locatedon.island WHERE city.name = 'Balikpapan'
Database: mondial_geo
Note: Sumatra is an island;
Question: List all the cities in Sumatra and state the population of each city.
SQL: SELECT city.name, city.population FROM city INNER JOIN locatedon ON city.name = locatedon.city INNER JOIN island ON island.name = locatedon.island WHERE island.name = 'Sumatra'
Database: mondial_geo
Note: 'South Yorkshire' is a province;
Question: On which island does South Yorkshire situated? State it's longtitude and latitude.
SQL: SELECT DISTINCT island.longitude, island.latitude FROM city INNER JOIN locatedon ON city.name = locatedon.city INNER JOIN island ON island.name = locatedon.island WHERE city.province = 'South Yorkshire'
Database: mondial_geo
Note: Warwickshire is a province;
Question: List all islands that are greater than the island on which Warwickshire is located.
SQL: SELECT DISTINCT name FROM island WHERE area > ( SELECT DISTINCT island.area FROM city INNER JOIN locatedon ON city.name = locatedon.city INNER JOIN island ON island.name = locatedon.island WHERE city.province = 'Warwickshire' )