Chinastark/bird_dataset huggingface dataset:
Database: world_development_indicators
Note: North American is the name of the region; sources refer to description; children who finished primary school education refer to indicatorname = 'Out-of-school children of primary school age, both sexes (number)';
Question: What are the sources for the data of children who finished primary school education in North American countries?
SQL: SELECT DISTINCT countrynotes.description FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode INNER JOIN countrynotes ON indicators.countrycode = countrynotes.countrycode WHERE country.region = 'North America' AND indicators.indicatorname = 'Out-of-school children of primary school age, both sexes (number)'
Database: world_development_indicators
Note: indicatorname = 'GDP growth (annual %)'; year = 2014;
Question: In the countries for which the latest trade data are from 2013, what was the GDP growth in 2014? List them in the ascending order of GDP.
SQL: SELECT DISTINCT country.countrycode, indicators.value FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.latesttradedata = 2013 AND indicators.indicatorname LIKE 'GDP growth (annual %)' AND indicators.year = 2014 AND indicators.value > 0 ORDER BY indicators.value ASC
Database: world_development_indicators
Note: year = 2005; private expenditure on health refers to indicatorname = 'Out-of-pocket health expenditure (% of private expenditure on health)'; the highest refers to MAX(value); source refers to description;
Question: Which European countries had the highest private expenditure on health in 2005? List the top ten countries in descending order and find the source of the data.
SQL: SELECT DISTINCT country.countrycode, countrynotes.description FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE indicators.indicatorname = 'Out-of-pocket health expenditure (% of private expenditure on health)' AND indicators.value > 0 AND indicators.year = 2005 ORDER BY indicators.value DESC LIMIT 10
Database: world_development_indicators
Note: South Asia is the name of the region; incomegroup = 'Low income';
Question: How many low income countries are there in South Asia?
SQL: SELECT count(countrycode) FROM country WHERE region = 'South Asia' AND incomegroup = 'Low income'
Database: world_development_indicators
Note: the latest trade data after 2010 implies latesttradedata > 2010;
Question: Please list the short name of countries which have the latest trade data after 2010.
SQL: SELECT shortname FROM country WHERE latesttradedata > 2010
Database: world_development_indicators
Note: Sub-Saharan African is the name of the region; systemoftrade = 'Special trade system'; countries refer to countrycode; DIVIDE(COUNT (countrycode where systemoftrade = 'Special trade system' and region = 'Sub-Saharan Africa'), COUNT(countrycode where region = 'Sub-Saharan Africa')) as percentage;
Question: Please calculate the percentage of Sub-Saharan African countries which are in the Special trade system.
SQL: SELECT  cast(sum(CASE WHEN region = 'Sub-Saharan Africa' THEN 1 ELSE 0 END) AS REAL) * 100 / count(countrycode) FROM country WHERE systemoftrade = 'Special trade system'
Database: world_development_indicators
Note: European & Central Asian is the name of the region; indicatorname = 'Arms imports (SIPRI trend indicator values)'; countries refer to countrycode; DIVIDE(Sum(value), Count(countrycode));
Question: Please calculate the average of Arms imports (SIPRI trend indicator values) of the European & Central Asian countries.
SQL: SELECT cast(sum(indicators.value) AS REAL) / count(country.countrycode) FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.region = 'Europe & Central Asia' AND indicators.indicatorname = 'Arms imports (SIPRI trend indicator values)'
Database: world_development_indicators
Note: incomegroup = 'Upper middle income'; indicatorname = 'CO2 emissions (kt); the lowest value refers to MIN(value);
Question: Which upper middle income country has the lowest value of CO2 emissions (kt)?
SQL: SELECT country.countrycode FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.incomegroup = 'Upper middle income' AND indicators.indicatorname = 'CO2 emissions (kt)' ORDER BY indicators.value ASC LIMIT 1
Database: world_development_indicators
Note: indicatorname = 'International migrant stock, total'; heavily indebted poor countries referred to by its abbreviated 'HIPC' = othergroups; MIN(value);
Question: What is the minimum of International migrant stock, total of heavily indebted poor countries?
SQL: SELECT min(indicators.value) FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.othergroups = 'HIPC' AND indicators.indicatorname = 'International migrant stock, total'
Database: world_development_indicators
Note: year = 'YR2000';
Question: Please list the indicator names belonging to Education: Inputs topic in 2000.
SQL: SELECT DISTINCT series.indicatorname FROM footnotes INNER JOIN series ON footnotes.seriescode = series.seriescode WHERE footnotes.year = 'YR2000' AND series.topic = 'Education: Inputs'
Database: world_development_indicators
Note: Annual refers to periodicity; from 2001 to 2003 implies year = 'YR2001', year = 'YR2002' , year = 'YR2003';
Question: How many annual indicators use the Sum aggregation method from 2001 to 2003?
SQL: SELECT count(DISTINCT series.seriescode)  FROM footnotes INNER JOIN series ON footnotes.seriescode = series.seriescode WHERE footnotes.year IN ('YR2001', 'YR2002', 'YR2003') AND series.periodicity = 'Annual' AND series.aggregationmethod = 'Sum'
Database: world_development_indicators
Note: year contains '2005'; series codes contain 'International Monetary Fund';
Question: In 2005, which series codes use the International Monetary Fund, Balance of Payments Statistics Yearbook and data files source?
SQL: SELECT footnotes.seriescode, series.source FROM footnotes INNER JOIN series ON footnotes.seriescode = series.seriescode WHERE footnotes.year LIKE '%2005%' AND series.source LIKE 'International Monetary Fund%'
Database: world_development_indicators
Note: South Asia is the name of the region; indicatorname = 'Life expectancy at birth, female (years)'; greater than 50 refers to value>50; DIVIDE(COUNT(countrycode where indicatorname = 'Life expectancy at birth, female (years)'; value>50; region = 'South Asia'), COUNT(countrycode where region = 'South Asia')) as percentage;
Question: What percentage of countries in South Asia have the Life expectancy at birth, female (years) greater than 50?
SQL: SELECT cast(sum(CASE WHEN indicators.value > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / count(country.countrycode) FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.region = 'South Asia' AND indicators.indicatorname = 'Life expectancy at birth, female (years)'
Database: world_development_indicators
Note: indicatorname = 'Death rate, crude (per 1,000 people)'; the highest refers to MAX(value); from 1960 to 1965 refers to year between '1960' and '1965'; country refers to countryname;
Question: From 1960 to 1965, which country had the highest Death rate, crude (per 1,000 people)?
SQL: SELECT countryname FROM indicators WHERE YEAR BETWEEN 1960 AND 1965 AND indicatorname = 'Death rate, crude (per 1,000 people)' ORDER BY value DESC LIMIT 1
Database: world_development_indicators
Note: Arab World refers to countryname; year = '1960'; values are higher than 50 refers to value>50;
Question: Please list the indicator names of Arab World whose values are higher than 50 in 1960.
SQL: SELECT indicatorname FROM indicators WHERE countryname = 'Arab World' AND YEAR = 1960 AND value > 50
Database: world_development_indicators
Note: country refers to countryname; the highest value implies MAX(value); indicatorname = 'Merchandise imports by the reporting economy (current US$)';
Question: Which country has the highest value of Merchandise imports by the reporting economy (current US$)?
SQL: SELECT countryname FROM indicators WHERE indicatorname = 'Merchandise imports by the reporting economy (current US$)' ORDER BY value DESC LIMIT 1
Database: world_development_indicators
Note: Annual refers to periodicity; values of more than 100 implies value>100; year = '1965';
Question: Please list annual indicator names which have values of more than 100 in 1965.
SQL: SELECT DISTINCT series.indicatorname FROM indicators INNER JOIN series ON indicators.indicatorname = series.indicatorname WHERE indicators.year = 1965 AND indicators.value > 100 AND series.periodicity = 'Annual'
Database: world_development_indicators
Note: From 1968 to 1970 refers to year between '1968' and '1970'; values are less than 100 imply value<100;
Question: From 1968 to 1970, what are indicator names whose license type is open and values are less than 100?
SQL: SELECT DISTINCT indicators.indicatorname FROM indicators INNER JOIN series ON indicators.indicatorname = series.indicatorname WHERE indicators.year >= 1968 AND indicators.year < 1971 AND series.licensetype = 'Open' AND indicators.value < 100
Database: world_development_indicators
Note: country refers to countryname;
Question: Which country had the highest value of indicator belongs to Private Sector & Trade: Exports topic? Please list the country name and indicator name.
SQL: SELECT indicators.countryname, indicators.indicatorname FROM indicators INNER JOIN series ON indicators.indicatorname = series.indicatorname WHERE series.topic = 'Private Sector & Trade: Exports' ORDER BY indicators.value DESC LIMIT 1
Database: world_development_indicators
Note: aggregationmethod = 'Weighted average'; the lowest value implies MIN(value);
Question: Which indicator name uses the Weighted average method and has the lowest value?
SQL: SELECT indicators.indicatorname, min(indicators.value) FROM indicators INNER JOIN series ON indicators.indicatorname = series.indicatorname WHERE series.aggregationmethod = 'Weighted average'
Database: world_development_indicators
Note: Sudan is the name of the country; periodicity = 'Annual'; year = '1961';
Question: Please list out all annual indicator names of Sudan in 1961?
SQL: SELECT indicators.indicatorname FROM indicators INNER JOIN series ON indicators.indicatorname = series.indicatorname WHERE indicators.countryname = 'Sudan' AND indicators.year = 1961 AND series.periodicity = 'Annual'
Database: world_development_indicators
Note: From 1960 to 1965 refers to year between '1960' and '1965'; the lowest value implies MIN(value); country refers to countryname;
Question: From 1960 to 1965, which country has the lowest value of indicator belongs to Health: Population: Structure?
SQL: SELECT countryname FROM indicators WHERE value = ( SELECT min(indicators.value) FROM indicators INNER JOIN series ON indicators.indicatorname = series.indicatorname WHERE indicators.year >= 1960 AND indicators.year < 1966 AND series.topic = 'Health: Population: Structure' )
Database: world_development_indicators
Note: indicatorname = 'CO2 emissions from liquid fuel consumption (% of total)'; less than 80% implies value<80%; incomegroup = 'Upper middle income'; DIVIDE(COUNT(countrycode where indicatorname = 'CO2 emissions from liquid fuel consumption (% of total)'; value<80%; incomegroup = 'Upper middle income'), COUNT(countrycode where incomegroup = 'Upper middle income'));
Question: What percentage of upper middle income countries which have the CO2 emissions from liquid fuel consumption (% of total)  less than 80%?
SQL: SELECT sum(CASE WHEN indicators.indicatorname = 'CO2 emissions FROM liquid fuel consumption (% of total)' AND indicators.value < 80 THEN 1 ELSE 0 END) * 1.0 / count(country.countrycode) persent FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.incomegroup = 'Upper middle income'
Database: world_development_indicators
Note: indicatorname = 'Rural population';
Question: What is indicator code of Rural population?
SQL: SELECT DISTINCT indicatorcode FROM indicators WHERE indicatorname = 'Rural population'
Database: world_development_indicators
Question: How many country uses the 2008 System of National Accounts methodology? List our their table name.
SQL: SELECT tablename  FROM country WHERE systemofnationalaccounts = 'Country uses the 2008 System of National Accounts methodology.'
Database: world_development_indicators
Question: List out the series code of countries using Euro as their currency unit.
SQL: SELECT DISTINCT countrynotes.seriescode FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE country.currencyunit = 'Euro'
Database: world_development_indicators
Question: List out the long name of countries using series code as DT.DOD.DSTC.CD
SQL: SELECT country.longname FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE countrynotes.seriescode = 'DT.DOD.DSTC.CD'
Database: world_development_indicators
Question: Mention the series code of countries using Hong Kong dollar as their currency unit.
SQL: SELECT countrynotes.seriescode FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE country.currencyunit = 'Hong Kong dollar'
Database: world_development_indicators
Question: List out the table name of countries using series code as SP.DYN.TO65.MA.ZS
SQL: SELECT country.tablename FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE countrynotes.seriescode = 'SP.DYN.TO65.MA.ZS'
Database: world_development_indicators
Note: lower earning countries refer to incomegroup = 'Low income';
Question: List out the country name of lower earning countries
SQL: SELECT DISTINCT indicators.countryname FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.incomegroup = 'Low income'
Database: world_development_indicators
Note: Latin American & Carribbean is the name of the region; poor countries refers to incomegroup = 'Low income';
Question: List out the series code and country code of the poor countries that located in Latin American & Carribbean.
SQL: SELECT countrynotes.seriescode, countrynotes.countrycode FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE country.region = 'Latin America & Caribbean' AND country.incomegroup = 'Low income'
Database: world_development_indicators
Note: middle income group refers to incomegroup = 'Low middle income';
Question: Mention the series code of countries using Australian dollar as their currency unit. Which country belongs to middle income group among them.
SQL: SELECT country.countrycode, countrynotes.seriescode FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE country.currencyunit = 'Australian dollar' AND country.incomegroup = 'Lower middle income'
Database: world_development_indicators
Note: incomegroup = 'Upper middle income'; the earliest national account base year refers to MIN(nationalaccountsbaseyear);
Question: List out the country name of upper middle income group. Which country has the earliest national account base year? List out the region where this country locates.
SQL: SELECT DISTINCT indicators.countryname FROM indicators INNER JOIN country ON indicators.countrycode = country.countrycode WHERE country.incomegroup = 'Upper middle income' UNION SELECT longname FROM ( SELECT longname FROM country WHERE nationalaccountsbaseyear <> '' ORDER BY nationalaccountsbaseyear ASC LIMIT 1 )
Database: world_development_indicators
Note: Non-OECD and OECD countries can be regarded as rich countries for those that are part of the High Income Group;
Question: List out the country code and country name of the rich countries using Euro as their currency unit
SQL: SELECT DISTINCT country.countrycode, indicators.countryname FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.currencyunit = 'Euro' AND (country.incomegroup = 'High income: OECD' OR country.incomegroup = 'High income: nonOECD')
Database: world_development_indicators
Question: List out the table name and currency unit of countries using series code as FP.CPI.TOTL
SQL: SELECT country.tablename, country.currencyunit FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE countrynotes.seriescode = 'FP.CPI.TOTL'
Database: world_development_indicators
Note: high income: non-OECD' refer to incomegroup;
Question: List out the name and indicator code of high income: nonOECD countries
SQL: SELECT DISTINCT country.countrycode, indicators.countryname FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.incomegroup = 'High income: nonOECD'
Database: world_development_indicators
Question: Mention the series code of countries using pound sterling as their currency unit. Which country belongs to high income group among them.
SQL: SELECT DISTINCT country.countrycode, country.currencyunit, country.incomegroup FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE country.currencyunit = 'Pound sterling' AND country.incomegroup LIKE '%high income%'
Database: world_development_indicators
Question: List down 10 country codes and it's short names.
SQL: SELECT countrycode, shortname FROM country LIMIT 10
Database: world_development_indicators
Note: countries name starts with alphabet A refers to shortname like 'A%';
Question: How many of the countries name start with alphabet A? List down the Alpha2Code of them.
SQL: SELECT count(shortname) FROM country WHERE shortname LIKE 'A%' UNION SELECT alpha2code FROM country WHERE shortname LIKE 'A%'
Database: world_development_indicators
Note: currencyunit = 'Euro';
Question: Which countries use Euro as their currency? List down the table name.
SQL: SELECT tablename FROM country WHERE currencyunit = 'Euro'
Database: world_development_indicators
Note: do not have special notes implies specialnotes are NULL;
Question: How many of the countries do not have special notes? List the long name.
SQL: SELECT count(longname) FROM country WHERE specialnotes = '' UNION SELECT longname FROM country WHERE specialnotes = ''
Database: world_development_indicators
Note: Asia is the name of the region;
Question: Which high income group countries are from Asia?
SQL: SELECT countrycode, region FROM country WHERE (incomegroup = 'High income: OECD' OR incomegroup = 'High income: nonOECD') AND region LIKE '%Asia%'
Database: world_development_indicators
Note: national accounts base year prior to 1980 means before 1980 and refers to nationalaccountsbaseyear<1980;
Question: Name the countries' long name with national accounts base year prior to 1980.
SQL: SELECT longname FROM country WHERE nationalaccountsbaseyear < '1980' AND nationalaccountsbaseyear != ''
Database: world_development_indicators
Note: incomegroup = 'Low income';
Question: Which low income country has a series code of DT.DOD.DECT.CD? Name the country code of it.
SQL: SELECT country.countrycode FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE country.incomegroup = 'Low income' AND countrynotes.seriescode = 'DT.DOD.DECT.CD'
Database: world_development_indicators
Question: State the table name of country with description of "Covers mainland Tanzania only".
SQL: SELECT DISTINCT country.tablename FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE countrynotes.description = 'Covers mainland Tanzania only.'
Database: world_development_indicators
Note: Benin is the short name of the country; year 2005 refers to year = 'YR2005';
Question: Write down the description and series code of Benin in year 2005.
SQL: SELECT footnotes.description, footnotes.seriescode FROM country INNER JOIN footnotes ON country.countrycode = footnotes.countrycode WHERE country.tablename = 'Benin' AND footnotes.year = 'YR2005'
Database: world_development_indicators
Note: Finland is the short name of the country; year 2000 refers to year = 'YR2000';
Question: What are the footnote description of Finland in year 2000?
SQL: SELECT DISTINCT footnotes.description FROM country INNER JOIN footnotes ON country.countrycode = footnotes.countrycode WHERE country.tablename = 'Finland' AND footnotes.year = 'YR2000'
Database: world_development_indicators
Question: What are the years when countries have indicator name of "Air transport, passengers carried"? List the table name of these countries.
SQL: SELECT DISTINCT indicators.year, country.tablename FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE indicators.indicatorname = 'Air transport, passengers carried'
Database: world_development_indicators
Note: with any indicator name implies indicatorname is not NULL; year = '1980';
Question: List the long name of countries with indicator name in 1980.
SQL: SELECT DISTINCT country.longname FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE indicators.year = 1980 AND indicators.indicatorname IS NOT NULL
Database: world_development_indicators
Note: Malaysia is the name of the country; currency refers to currencyunit; year = '1970';
Question: State the currency of Malaysia and what are the indicator code used by this country in 1970?
SQL: SELECT country.currencyunit, indicators.indicatorcode FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.tablename = 'Malaysia' AND indicators.year = 1970
Database: world_development_indicators
Note: with highest value refers to MAX(value);
Question: Name 5 country codes of country with highest value and state the region of these countries.
SQL: SELECT DISTINCT country.countrycode, country.region FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode ORDER BY indicators.value DESC LIMIT 5
Database: world_development_indicators
Note: countries refer to countrycode; currency refers to currencyunit;
Question: How many countries have country note description as "Sources: UN Energy Statistics (2014)"? List the currency of these countries.
SQL: SELECT count(DISTINCT country.countrycode) FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE countrynotes.description = 'Sources: UN Energy Statistics (2014)' UNION SELECT DISTINCT country.currencyunit FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE countrynotes.description = 'Sources: UN Energy Statistics (2014)'
Database: world_development_indicators
Note: year 1980 refers to year = 'YR1980';
Question: How many footnotes have been made in year 1980 and what are the table names of these countries that made the footnotes?
SQL: SELECT count(footnotes.description) FROM country INNER JOIN footnotes ON country.countrycode = footnotes.countrycode WHERE footnotes.year = 'YR1980' UNION ALL SELECT DISTINCT country.tablename FROM country INNER JOIN footnotes ON country.countrycode = footnotes.countrycode WHERE footnotes.year = 'YR1980'
Database: world_development_indicators
Question: List the series code of country with country notes description as "Data sources : Eurostat" and state the Wb2Code of these countries.
SQL: SELECT countrynotes.seriescode, country.wb2code FROM country INNER JOIN countrynotes ON country.countrycode = countrynotes.countrycode WHERE countrynotes.description = 'Data sources : Eurostat'
Database: world_development_indicators
Note: fertility rate refers to indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'; lowest refers to MIN(value); incomegroup = 'Low income';
Question: Among the low income countries, which country has the lowest fertility rate?
SQL: SELECT indicators.countryname FROM country INNER JOIN indicators ON country.countrycode = indicators.countrycode WHERE country.incomegroup = 'Low income' AND indicators.indicatorname = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' ORDER BY indicators.value LIMIT 1