db_id
stringclasses
68 values
question
stringlengths
33
321
evidence
stringlengths
0
673
SQL
stringlengths
116
743
question_id
int64
3
6.6k
difficulty
stringclasses
2 values
works_cycles
What is the profit of a single product that received the highest rating from John Smith? List the product/s' names.
highest rating refers to Rating = 5; profit = SUBTRACT(ListPrice, StandardCost);
SELECT T1.ListPrice - T1.StandardCost, T1.Name FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T2.ReviewerName = 'John Smith' ORDER BY T2.Rating DESC LIMIT 1
5,307
moderate
works_cycles
Please provide contact details of all Marketing Managers. State their name and phone number.
Marketing Manager is a job title
SELECT T1.FirstName, T1.LastName, T2.PhoneNumber FROM Person AS T1 INNER JOIN PersonPhone AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Employee AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T3.JobTitle = 'Marketing Manager'
1,699
moderate
works_cycles
Who are the employees that submitted resume to Human Resource Department and got hired? State the last name.
employees that submitted resume to Human Resource Department and got hired refers to BusinessEntittyID NOT null;
SELECT T3.LastName FROM Employee AS T1 INNER JOIN JobCandidate AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Person AS T3 ON T1.BusinessEntityID = T3.BusinessEntityID WHERE T1.BusinessEntityID IN (212, 274)
2,063
moderate
works_cycles
What is the average age of the sales agents in the company by 12/31/2009?
average age as of 12/31/2009 = AVG(SUBTRACT(2009, year(BirthDate));
SELECT AVG(2009 - STRFTIME('%Y', T2.BirthDate)) FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.PersonType = 'SP'
897
moderate
works_cycles
Calculate the average age of employee in each department and state which department has the youngest employees.
Average = Divide(Sum(Substract(year(@today),year(BirthDate))),Count(BusinessEntityID) by each Department ID; youngest employee refers to Min(BirthDate);
SELECT STRFTIME('%Y', CURRENT_TIMESTAMP) - STRFTIME('%Y', T1.BirthDate) + 1 , T3.Name FROM Employee AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 USING (BusinessEntityID) INNER JOIN Department AS T3 USING (DepartmentID) ORDER BY T1.BirthDate DESC LIMIT 1
3,370
moderate
works_cycles
Which product allows the company to make the highest profit on a single item among those that are the fastest to manufacture? Indicate the rating of the product if there any.
profit on a single item = SUBTRACT(ListPrice, StandardCost); length of time to manufacture refers to DaysToManufacture; fastest to manucature refers to MIN(DaysToManufacture);
SELECT T1.Name, T2.Rating FROM Product AS T1 INNER JOIN ProductReview AS T2 ON T1.ProductID = T2.ProductID WHERE T1.DaysToManufacture = ( SELECT DaysToManufacture FROM Product ORDER BY DaysToManufacture LIMIT 1 ) ORDER BY T1.ListPrice - T1.StandardCost DESC LIMIT 1
2,223
challenging
works_cycles
Please list the products that are under the Clothing category that are manufactured in-house and salable.
product is manufactured in-house refers to MakeFlag = 1; salable product refers to FinishedGoodsFlag = 1;
SELECT CASE WHEN T1.MakeFlag = 1 THEN T1.Name END FROM Product AS T1 INNER JOIN ProductSubcategory AS T2 ON T1.ProductSubcategoryID = T2.ProductSubcategoryID INNER JOIN ProductCategory AS T3 ON T2.ProductCategoryID = T3.ProductCategoryID WHERE T2.ProductSubcategoryID = 3
2,259
challenging
works_cycles
Among all the employees who don't wish to receive promotion e-mails, how many of them belong to or once belonged to the Engineering Department?
Employees who don't wish to receive e-mail promotions refers to EmailPromotion = 0;
SELECT COUNT(T1.BusinessEntityID) FROM EmployeeDepartmentHistory AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN Department AS T3 ON T1.DepartmentID = T3.DepartmentID WHERE T3.Name = 'Engineering' AND T2.EmailPromotion = 0
4,504
moderate
works_cycles
Which chromoly steel product model has AdventureWorks saved in English?
Saved in English refers to product description written in English where Culture.name = 'English'
SELECT T1.ProductModelID FROM ProductModelProductDescriptionCulture AS T1 INNER JOIN Culture AS T2 USING (cultureid) INNER JOIN ProductDescription AS T3 USING (productdescriptionid) WHERE T3.Description LIKE 'Chromoly steel%' AND T2.Name = 'English'
4,248
moderate
works_cycles
What is the difference in percentage between the product descriptions written in Arabic and Thai?
Arabic and Thai are language names refers to name = 'Arabic'and name = 'Thai'; Differencce in percentage = Subtract(((Count(CultureID(name = 'Arabic'))/Count(CultureID))*100),((Count(CultureID(name = 'Thai'))/Count(CultureID))*100)));
SELECT CAST(SUM(CASE WHEN T1.Name = 'Arabic' THEN 1 ELSE 0 END) AS REAL) * 100 / SUM(CASE WHEN T1.Name = 'Thai' THEN 1 ELSE 0 END) FROM Culture AS T1 INNER JOIN ProductModelProductDescriptionCulture AS T2 ON T1.CultureID = T2.CultureID
2,933
challenging
works_cycles
What is the percentage of employees who work the night shift?
percentage = DIVIDE(SUM(Name = 'Night')), (COUNT(ShiftID)) as percentage;
SELECT CAST(SUM(CASE WHEN T1.Name = 'Night' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T2.BusinessEntityID) FROM Shift AS T1 INNER JOIN EmployeeDepartmentHistory AS T2 ON T1.ShiftId = T2.ShiftId
4,836
moderate
works_cycles
What is the full name of the second oldest person in the company at the time he was hired?
age at the time of being hired = SUBTRACT(HireDate, BirthDate); full name = FirstName+MiddleName+LastName;
SELECT T2.FirstName, T2.MiddleName, T2.LastName FROM Employee AS T1 INNER JOIN Person AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID ORDER BY STRFTIME('%Y', T1.HireDate) - STRFTIME('%Y', T1.BirthDate) DESC LIMIT 1, 1
573
moderate
works_cycles
Among the products with an average lead time of 60, which vendor has the highest profit on net? Indicate the credit rating of such vendor.
profit on net = SUBTRACT(LastReceiptCost, StandardPrice);
SELECT T2.Name, T2.CreditRating FROM ProductVendor AS T1 INNER JOIN Vendor AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID WHERE T1.AverageLeadTime = 60 ORDER BY T1.LastReceiptCost - T1.StandardPrice DESC LIMIT 1
4,586
moderate
works_cycles
Among the products that get over at least 1 review, how many of them are from the mountain product line?
mountain product line refers to ProductLine = 'M'
SELECT SUM(CASE WHEN T2.ProductLine = 'M' THEN 1 ELSE 0 END) FROM ProductReview AS T1 INNER JOIN Product AS T2 ON T1.ProductID = T2.ProductID GROUP BY T1.ProductID HAVING COUNT(T1.ProductReviewID) > 1
1,831
moderate
works_cycles
List all staff in the Shipping and Receiving department who are hired in 2009.
hired in 2009 refers to year(HireDate) = 2009
SELECT T1.FirstName, T1.LastName FROM Person AS T1 INNER JOIN Employee AS T2 ON T1.BusinessEntityID = T2.BusinessEntityID INNER JOIN EmployeeDepartmentHistory AS T3 ON T2.BusinessEntityID = T3.BusinessEntityID INNER JOIN Department AS T4 ON T3.DepartmentID = T4.DepartmentID WHERE STRFTIME('%Y', T2.HireDate) = '2009' AND T4.Name = 'Shipping and Receiving'
939
moderate
world
Within the 5 most crowded cities in the world, which country has the most languages used?
most crowded cities refers to MAX(Population); has the most languages used refers to MAX(COUNT(Language));
SELECT Name FROM ( SELECT T1.Name, T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode GROUP BY T1.Name, T1.Population, T2.Language ORDER BY T1.Population DESC ) AS T3 GROUP BY t3.Name ORDER BY COUNT(Language) DESC LIMIT 1
1,257
moderate
world
In countries with constitutional monarchy, what is the percentage of cities located in the district of England?
constitutional monarchy refers to GovernmentForm = 'Constitutional Monarchy'; percentage = MULTIPLY(DIVIDE(SUM(GovernmentForm = 'Constitutional Monarchy' WHERE District = 'England'), COUNT(GovernmentForm = 'Constitutional Monarchy')), 100)
SELECT CAST(SUM(CASE WHEN T1.District = 'England' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GovernmentForm = 'Constitutional Monarchy'
568
moderate
world
In English speaking countries, provide the difference between the number of countries with republic and constitutional monarchy as its government form.
English speaking refers to Language = 'English' ; difference = SUBTRACT(COUNT(Language = 'English' WHERE GovernmentForm = 'Republic'), COUNT(Language = 'English' WHERE GovernmentForm = 'ConstitutionalMonarchy'));
SELECT COUNT(T1.GovernmentForm = 'Republic') - COUNT(T1.GovernmentForm = 'ConstitutionalMonarchy') FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English'
913
moderate
world
Provide the name, capital city and its official language of the country with the highest life expectancy.
capital city refers to Capital; official language refers to IsOfficial = 'T'; highest life expectancy refers to MAX(LifeExpectancy);
SELECT T1.Name, T1.Capital, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode INNER JOIN City AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.LifeExpectancy DESC LIMIT 1
1,700
moderate
world
Among the cities with a population between 140000 and 150000, list the country that has life expectancy greater than 80% life expectancy of all countries.
life expectancy greater than 80% life expectancy of all countries refers to LifeExpectancy < (MULTIPLY(AVG(LifeExpectancy), 0.8));
SELECT T2.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.Population BETWEEN 140000 AND 150000 GROUP BY T2.Name, LifeExpectancy HAVING LifeExpectancy < ( SELECT AVG(LifeExpectancy) FROM Country ) * 0.8
3,031
moderate
world
Among the countries that have GNP greater than 1500, what is the percentage of the countries have English as its language?
GNP greater than 1500 refers to GNP > 1500 ; percentage = MULTIPLY(DIVIDE(SUM(Code WHERE GNP > 1500 AND Language = 'English'), COUNT(Code WHERE GNP > 1500)) 1.0); English as its language refers to Language = 'English';
SELECT CAST(SUM(IIF(T2.Language = 'English', 1, 0)) AS REAL) * 100 / COUNT(T1.Code) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GNP > 1500
5,739
moderate
world
Calculate the percentage of the surface area of all countries that uses Chinese as one of their languages.
percentage = DIVIDE(MULTIPLY(SUM(SurfaceArea WHERE Language = 'Chinese'), SUM(SurfaceArea)), 1.0); Chinese as one of the languages refers to Language = 'Chinese';
SELECT CAST(SUM(IIF(T2.Language = 'Chinese', T1.SurfaceArea, 0)) AS REAL) * 100 / SUM(T1.SurfaceArea) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode
5,767
moderate
world_development_indicators
Mention the series code of countries using pound sterling as their currency unit. Which country belongs to high income group among them.
SELECT DISTINCT T1.CountryCode, T1.CurrencyUnit, T1.IncomeGroup FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.CurrencyUnit = 'Pound sterling' AND T1.IncomeGroup LIKE '%high income%'
3,095
moderate
world_development_indicators
What is the percentage of increase of the indicator on Adolescent fertility rate from 1960 to 1961 in the country whose Alpha2Code is 1A?
the percentage of increase from 1960 to 1961 = divide(subtract(sum(value where Year = 1961), sum(Value where Year = 1960)), sum(Value where Year = 1960)) *100%; indicator on Adolescent fertility rate refers to IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)%'
SELECT (( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1961 ) - ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 )) * 1.0 / ( SELECT SUM(T2.Value) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 )
3,500
challenging
world_development_indicators
What are the sources for the data of children who finished primary school education in Latin America & Caribbean countries?
Latin America & Caribbean is the name of the region; children who finished primary school education refer to IndicatorName = 'Out-of-school children of primary school age, both sexes (number)'; sources refer to Description;
SELECT DISTINCT T2.Source FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode INNER JOIN Country AS T3 ON T1.Countrycode = T3.CountryCode WHERE T3.Region = 'Latin America & Caribbean' AND T2.IndicatorName = 'Children out of school, primary'
2,279
moderate
world_development_indicators
Among the low income countries, which country has the lowest fertility rate?
fertility rate refers to IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'; lowest refers to MIN(Value); IncomeGroup = 'Low income';
SELECT T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Low income' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' ORDER BY T2.Value LIMIT 1
5,831
moderate
world_development_indicators
Which country's indicator for Adolescent fertility rate is the highest in 1960, please give its special notes.
indicator for Adolescent fertility rate is the highest refers to max(value where IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)'); in 1960 refers to year = '1960'
SELECT DISTINCT T1.CountryCode, T1.SpecialNotes FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Value = ( SELECT Value FROM Indicators WHERE IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND Year = 1960 ORDER BY Value DESC LIMIT 1 )
2,565
moderate
world_development_indicators
By how much did the indicator on Adolescent fertility rate increase from 1960 to 1961 in the country whose Alpha2Code is 1A?
by how much = subtract(sum(value where Year = 1961), sum(value where Year = 1960)); indicator on Adolescent fertility rate refers to IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)%'
SELECT ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1961 ) - ( SELECT T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Alpha2Code = '1A' AND T2.IndicatorName = 'Adolescent fertility rate (births per 1,000 women ages 15-19)' AND T2.Year = 1960 ) DIFF
2,027
challenging
world_development_indicators
What is the long name of the country with the description "Estimates are derived from data on foreign-born population." on the series code SM.POP.TOTL?
SELECT T1.LongName FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Estimates are derived FROM data on foreign-born population.' AND T2.Seriescode = 'SM.POP.TOTL'
3,792
moderate
world_development_indicators
What upper middle income country under East Asia & Pacific region which covers the topic about Social Protection & Labor: Migration ? Indicate the short name of the said country.
upper middle income country refers to incomegroup = 'Upper middle income'
SELECT DISTINCT T1.ShortName FROM Country AS T1 INNER JOIN footnotes AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T1.IncomeGroup = 'Upper middle income' AND T1.Region = 'East Asia & Pacific' AND T3.Topic = 'Social Protection & Labor: Migration'
4,809
moderate
world_development_indicators
Please list the countries that got the footnote "Data are classified as official aid." on the series code DC.DAC.AUSL.CD in 2002.
countries are the Countrycode; footnote refers to Description = 'Data are classified as official aid'
SELECT T1.SHORTNAME FROM Country AS T1 INNER JOIN FootNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Data are classified as official aid.' AND T2.Seriescode = 'DC.DAC.AUSL.CD' AND T2.Year LIKE '%2002%'
4,673
moderate
world_development_indicators
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.
IndicatorName = 'GDP growth (annual %)'; Year = 2014;
SELECT DISTINCT T1.CountryCode, T2.Value FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.LatestTradeData = 2013 AND T2.IndicatorName LIKE 'GDP growth (annual %)' AND T2.year = 2014 AND T2.Value > 0 ORDER BY T2.Value ASC
4,025
moderate
world_development_indicators
How many countries have reached their Adjusted net national income per capita (constant 2005 US$) indicator value to more than 1,000 but have not finished their external debt reporting?
Adjusted net national income per capita (constant 2005 US$) is the IndicatorName; have not finished their external debt reporting means ExternalDebtReportingStatus = 'Preliminary'
SELECT COUNT(T1.CountryCode) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Adjusted net national income per capita (constant 2005 US$)' AND T1.ExternalDebtReportingStatus = 'Preliminary' AND T2.Value > 1000
719
moderate
world_development_indicators
Which nation completed its external debt reporting in 1980 and had a Land under cereal production value of 3018500?
completed its external debt reporting refers to ExternalDebtReportingStatus = 'Actual'; in 1980 refers to year = 1980; Land under cereal production value of 3018500 refers to value = 3018500
SELECT T2.CountryCode FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName LIKE 'Land under cereal production%' AND T1.Value = 3018500 AND T1.Year = 1980 AND T2.ExternalDebtReportingStatus = 'Actual'
3,192
moderate
world_development_indicators
How many countries are having their country's footnotes described as "unspecified"? Please provide the full names of any three of those countries.
described as "unspecified" refers to Description = 'Not specified'; full names refers to LongName
SELECT COUNT(DISTINCT T1.CountryCode) FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Unspecified' OR T2.Description = 'Not specified' UNION SELECT T1.LongName FROM Country AS T1 INNER JOIN Footnotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Unspecified' OR T2.Description = 'Not specified' LIMIT 4
220
challenging
world_development_indicators
List down the top 3 Latin American & Caribbean countries with the highest average value in "CO2 emissions (kt)" indicator since 1965. Give their highest value and in what year.
Latin American & Caribbean countries is the name of the region where Region in ('Latin America' , 'Caribbean'); CO2 emissions from gaseous fuel consumption (kt) is the name of indicator where IndicatorName = 'CO2 emissions from gaseous fuel consumption (kt)'; average value in CO2 emissions (kt) = DIVIDE(SUM(Value), SUM(IndicatorName = 'CO2 emissions from gaseous fuel consumption (kt)')); Year > 1965
SELECT DISTINCT T1.CountryCode, T1.Year, T1.Value FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Latin America & Caribbean' AND T1.IndicatorName = 'CO2 emissions (kt)' AND T1.Year > 1965 AND T1.Year < 1980 ORDER BY T1.Value DESC LIMIT 3
2,553
moderate
world_development_indicators
Please list the notes for Aruba on the indicators under the topic of Environment: Energy production & use.
note refers to Description; for Aruba refers to ShortName = 'Aruba'
SELECT T2.Description FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode INNER JOIN Series AS T3 ON T2.Seriescode = T3.SeriesCode WHERE T1.ShortName = 'Aruba' AND T3.Topic = 'Environment: Energy production & use'
5,776
moderate
world_development_indicators
How many annual indicators use the Sum aggregation method from 2001 to 2003?
Annual refers to Periodicity; from 2001 to 2003 implies Year = 'YR2001', Year = 'YR2002' , Year = 'YR2003';
SELECT COUNT(DISTINCT T2.SeriesCode) FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T1.Year IN ('YR2001', 'YR2002', 'YR2003') AND T2.Periodicity = 'Annual' AND T2.AggregationMethod = 'Sum'
6,154
moderate
world_development_indicators
List the sources for the Net Migration in South American countries in 2002.
South American is the name of the region; Year contains '2002'; sources refer to Description; IndicatorName = 'Net migration';
SELECT T2.Source FROM CountryNotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode INNER JOIN Country AS T3 ON T1.Countrycode = T3.CountryCode INNER JOIN SeriesNotes AS T4 ON T2.SeriesCode = T4.Seriescode WHERE T4.Year LIKE '%2002%' AND T2.IndicatorName = 'Net migration'
4,914
moderate
world_development_indicators
In Sub-Saharan Africa, how many female out-of-school children of primary school age are there in the country with the higest number of female out-of-school children of primary school age? Indicate the year of when it was recorded.
in Sub-Saharan Africa refers to Region = 'Sub-Saharan Africa'; the higest number of female out-of-school children of primary school age refers to max(value where IndicatorName = 'Out-of-school children of primary school age, female (number)')
SELECT MAX(T1.value), T1.year FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Sub-Saharan Africa' AND T1.IndicatorName = 'Out-of-school children of primary school age, female (number)'
1,574
moderate
world_development_indicators
How many low-income countries under the lending category of the International Development Associations have a note on the series code SM.POP.TOTL?
low-income countries are where the incomegroup = Low income
SELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.LendingCategory = 'IDA' AND T2.Seriescode = 'SM.POP.TOTL' AND IncomeGroup = 'Low income'
2,978
moderate
world_development_indicators
List down the World Bank code of the countries whose country note has described "Data source : Human Mortality Database by University of California, Berkeley, and Max Planck Institute for Demographic Research."? Please include their lending category.
World Bank code refers to Wb2code; Data source refers to Description
SELECT DISTINCT T1.Wb2code, T1.LendingCategory FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T2.Description = 'Data source : Human Mortality Database by University of California, Berkeley, and Max Planck Institute for Demographic Research.' AND T1.LendingCategory != ''
3,693
challenging
world_development_indicators
Among the countries who uses the 1968 System of National Accounts methodology, how many are in the Middle East & North Africa? Name the country with the highest CO2 emissions from solid fuel consumption in kiloton.
uses the 1968 System of National Accounts methodology refers to SystemOfNationalAccounts = '1968 System of National Accounts methodology'; in the Middle East & North Africa refers to Region = 'Middle East & North Africa'; the highest CO2 emissions from solid fuel consumption in kiloton refers to max(value where IndicatorName = 'CO2 emissions from solid fuel consumption (kt)')
SELECT COUNT(DISTINCT T1.CountryCode) FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Middle East & North Africa' AND T2.SystemOfNationalAccounts = 'Country uses the 1968 System of National Accounts methodology.' AND T1.IndicatorName = 'CO2 emissions FROM solid fuel consumption (kt)' UNION SELECT * FROM ( SELECT T1.CountryName FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Middle East & North Africa' AND T2.SystemOfNationalAccounts = 'Country uses the 1968 System of National Accounts methodology.' AND T1.IndicatorName = 'CO2 emissions FROM solid fuel consumption (kt)' GROUP BY T1.CountryName ORDER BY SUM(T1.value) DESC LIMIT 1 )
816
challenging
world_development_indicators
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.
IncomeGroup = 'Upper middle income'; the earliest national account base year refers to MIN(NationalAccountsBaseYear);
SELECT DISTINCT T1.CountryName FROM indicators AS T1 INNER JOIN country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IncomeGroup = 'Upper middle income' UNION SELECT longname FROM ( SELECT longname FROM country WHERE NationalAccountsBaseYear <> '' ORDER BY NationalAccountsBaseYear ASC LIMIT 1 )
2,701
moderate
world_development_indicators
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.
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;
SELECT DISTINCT T1.CountryCode, T3.Description FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T1.CountryCode = T3.Countrycode WHERE T2.IndicatorName = 'Out-of-pocket health expenditure (% of private expenditure on health)' AND T2.Value > 0 AND T2.year = 2005 ORDER BY T2.Value DESC LIMIT 10
907
challenging
world_development_indicators
Name the country with fastest growth in adjusted net national income in 1980 and state the currency used by this country.
fastest growth refers to MAX(Value); IndicatorName = 'Adjusted net national income (annual % growth)'; Year = '1980'; currency refers to CurrencyUnit;
SELECT T2.countryname, T1.CurrencyUnit FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IndicatorName = 'Adjusted net national income (annual % growth)' AND T2.Year = 1980 AND T1.CurrencyUnit != '' ORDER BY T2.Value DESC LIMIT 1
20
moderate
world_development_indicators
In 1970, how many Middle Eastern & North African countries whose value for CO2 emissions from gaseous fuel consumption (kt) indicator is more than 600?
Year = 1970; Middle East & North Africa is the name of the region where Region = 'Middle East & North Africa'; CO2 emissions from gaseous fuel consumption (kt) is the name of indicator where IndicatorName = 'CO2 emissions from gaseous fuel consumption (kt)'
SELECT COUNT(T2.CountryCode) FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Region = 'Middle East & North Africa' AND T1.IndicatorName = 'CO2 emissions FROM gaseous fuel consumption (kt)' AND T1.Year = 1970 AND T1.Value > 600
4,419
moderate
world_development_indicators
What percentage of countries in South Asia have the Life expectancy at birth, female (years) greater than 50?
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;
SELECT CAST(SUM(CASE WHEN T2.value > 50 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(T1.CountryCode) FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.Region = 'South Asia' AND T2.IndicatorName = 'Life expectancy at birth, female (years)'
5,642
moderate
world_development_indicators
From 1975 to 1980, how much is the total amount CO2 emmission in kiloton of the the world? Indicate which year the world recorded its highest CO2 emmissions.
from 1975 to 1980 refers to Year between 1975 and 1980; the total amount CO2 emmission in kiloton of the the world refers to sum(value where IndicatorName like 'CO2%'); the world recorded its highest CO2 emmissions refers to max(value where IndicatorName like 'CO2%')
SELECT SUM(T1.Value), T1.Year FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'CO2 emissions (kt)' AND T1.Year >= 1975 AND T1.Year < 1981 AND T1.CountryCode = 'WLD' AND T2.SpecialNotes = 'World aggregate.'
1,771
moderate
world_development_indicators
What is the average number of passengers carried via air transport per year by Bulgaria between 1970 to 1980? Indicate the country's system of trade.
average number refers to avg(value); passengers carried via air transport per year refers to value where IndicatorName = 'Air transport, passengers carried'; by Bulgaria refers to CountryName = 'Bulgaria'; between 1970 to 1980 refers to Year between 1970 and 1980
SELECT AVG(T1.Value), T2.SystemOfTrade FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Air transport, passengers carried' AND T1.Year >= 1970 AND T1.Year < 1981 AND T1.CountryName = 'Bulgaria'
1,300
moderate
world_development_indicators
List out the country code and country name of the rich countries using Euro as their currency unit
Non-OECD and OECD countries can be regarded as rich countries for those that are part of the High Income Group;
SELECT DISTINCT T1.CountryCode, T2.CountryName FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.CurrencyUnit = 'Euro' AND (T1.IncomeGroup = 'High income: OECD' OR T1.IncomeGroup = 'High income: nonOECD')
2,615
moderate
world_development_indicators
What is the ratio between country with the highest number of infant deaths in 1971 and the lowest number of infant deaths in 1971? List the country with the highest number of infant deaths in 1971 and the lowest number of infant deaths in 1971.
ratio = divide(max(value where indicatorname = 'Number of infant deaths' and year = '1971'), min(value where indicatorname = 'Number of infant deaths' and year = '1971')); the highest number of infant deaths in 1971 refers to max(value where indicatorname = 'Number of infant deaths' and year = '1971'); the lowest number of infant deaths in 1971 refers to min(value where indicatorname = 'Number of infant deaths' and year = '1971')
SELECT CAST(MAX(value) AS REAL) / MIN(value) FROM indicators WHERE indicatorname = 'Number of infant deaths' AND year = '1971' UNION ALL SELECT countryname FROM ( SELECT countryname, MAX(value) FROM indicators WHERE indicatorname = 'Number of infant deaths' AND year = '1971' ) UNION SELECT countryname FROM ( SELECT countryname, MIN(value) FROM indicators WHERE indicatorname = 'Number of infant deaths' AND year = '1971' )
2,225
challenging
world_development_indicators
In 2005, which series codes use the International Monetary Fund, Balance of Payments Statistics Yearbook and data files source?
Year contains '2005'; series codes contain 'International Monetary Fund'
SELECT T1.Seriescode, T2.Source FROM Footnotes AS T1 INNER JOIN Series AS T2 ON T1.Seriescode = T2.SeriesCode WHERE T1.Year LIKE '%2005%' AND T2.Source LIKE 'International Monetary Fund%'
2,834
moderate
world_development_indicators
Please calculate the percentage of Sub-Saharan African countries which are in the Special trade system.
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;
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'
4,191
moderate
world_development_indicators
What is the average value of Adjusted net enrolment rate, primary, both sexes (%) indicator in Algeria from 1975 to 1980?
the average value of Adjusted net enrolment rate, primary, both sexes (%) is DIVIDE(SUM(Value), SUM(IndicatorName = 'Adjusted net enrolment rate, primary, both sexes (%)')); Year BETWEEN 1975 AND 1980; Algeria is the name of country where CountryName = 'Algeria'
SELECT CAST(SUM(Value) AS REAL) / COUNT(CountryCode) FROM Indicators WHERE CountryName = 'Algeria' AND Year > 1974 AND Year < 1981 AND IndicatorName = 'Adjusted net enrolment rate, primary, both sexes (%)'
4,988
moderate
world_development_indicators
Enumerate the footnote narratives of The Bahamas under the series code SH.DTH.IMRT in the year 1984.
narratives is Description; The Bahamas is the name of the country where Country = 'The Bahamas'
SELECT DISTINCT T1.Description FROM FootNotes AS T1 INNER JOIN Country AS T2 ON T1.Countrycode = T2.CountryCode WHERE T1.Year = 'YR1984' AND T2.ShortName = 'The Bahamas' AND T1.Seriescode = 'SH.DTH.IMRT'
4,271
moderate
world_development_indicators
Which country has the highest population in largest city for 19 consecutive years starting from 1960? Indicate the region to which the country is located.
the highest population in largest city refers to max(value where IndicatorName = 'Population in largest city'); for 19 consecutive years starting from 1960 refers to Year BETWEEN'1960' and '1979'
SELECT T2.CountryCode, T2.Region FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Population in largest city' AND T1.Year >= 1960 AND T1.Year < 1980 ORDER BY T2.Region DESC LIMIT 1
2,232
moderate
world_development_indicators
What are the sources for the data of children who finished primary school education in North American countries?
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)';
SELECT DISTINCT T3.Description FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T2.CountryCode = T3.Countrycode WHERE T1.Region = 'North America' AND T2.IndicatorName = 'Out-of-school children of primary school age, both sexes (number)'
4,768
moderate
world_development_indicators
What is the series code for number of infant deaths in year 1965 for the country whose full name is Islamic State of Afghanistan?
number of infant deaths refers to IndicatorName = 'Number of infant deaths'; in year 1965 refers to Year = '1965'; full name is Islamic State of Afghanistan refers to LongName = 'Islamic State of Afghanistan'
SELECT DISTINCT T3.Seriescode FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode INNER JOIN CountryNotes AS T3 ON T2.CountryCode = T3.Countrycode WHERE T2.IndicatorName = 'Number of infant deaths' AND T1.LongName = 'Islamic State of Afghanistan' AND T2.Year = 1965
6,192
moderate
world_development_indicators
Which country has the smallest land area in square kilometers for 19 consecutive years starting from year 1961? Indicate how much is its land area in square kilometers in those years and the income group of the country.
the smallest land area in square kilometers refers to min(value where IndicatorName like 'Land area (sq. km)'); for 19 consecutive years starting from year 1961 refers to Year between 1961 and 1979
SELECT T1.CountryName, SUM(T1.Value) area, T2.IncomeGroup FROM Indicators AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IndicatorName = 'Land area (sq. km)' AND T1.Year >= 1961 AND T1.Year < 1980 GROUP BY T1.CountryCode ORDER BY SUM(T1.Value) ASC LIMIT 1
2,106
moderate
world_development_indicators
Among the countries in the High income: OECD group whose currency unit is Euro, how many of them have a note on the series code SP.DYN.AMRT.FE?
countries refer to Countrycode; in the high income refers to incomegroup = 'High'; with notes refers to description IS NOT NULL; series code SP.DYN.AMRT.FE refers to Seriescode = 'SP.DYN.AMRT.FE'
SELECT COUNT(T1.Countrycode) FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.IncomeGroup = 'High income: OECD' AND T1.CurrencyUnit = 'Euro' AND T2.Seriescode = 'SP.DYN.AMRT.FE'
2,298
moderate
world_development_indicators
What's the value of the indicator whose long definition is "Adolescent fertility rate is the number of births per 1,000 women ages 15-19." for the Arab World in 1960?
in 1960 refers to Year = 1960; for the Arab World refers to CountryName = 'Arab World'
SELECT T1.Value FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName INNER JOIN Country AS T3 ON T1.CountryCode = T3.CountryCode WHERE T2.LongDefinition = 'Adolescent fertility rate is the number of births per 1,000 women ages 15-19.' AND T3.ShortName = 'Arab World' AND T1.Year = 1960
321
moderate
world_development_indicators
From 1960 to 1965, which country has the lowest value of indicator belongs to Health: Population: Structure?
From 1960 to 1965 refers to Year between '1960' and '1965'; the lowest value implies MIN(Value); country refers to CountryName;
SELECT CountryName FROM Indicators WHERE Value = ( SELECT MIN(T1.Value) FROM Indicators AS T1 INNER JOIN Series AS T2 ON T1.IndicatorName = T2.IndicatorName WHERE T1.Year >= 1960 AND T1.Year < 1966 AND T2.Topic = 'Health: Population: Structure' )
4,244
moderate
world_development_indicators
What percentage of upper middle income countries which have the CO2 emissions from liquid fuel consumption (% of total) less than 80%?
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'));
SELECT SUM(CASE WHEN T2.IndicatorName = 'CO2 emissions FROM liquid fuel consumption (% of total)' AND t2.Value < 80 THEN 1 ELSE 0 END) * 1.0 / COUNT(T1.CountryCode) persent FROM Country AS T1 INNER JOIN Indicators AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.IncomeGroup = 'Upper middle income'
1,407
moderate
world_development_indicators
Which form of government has more countries that have completed the actual external debt reporting between the two types of government accounting concepts, budgetary central government vs. consolidated central government?
have completed the actual external debt reporting refers to ExternalDebtReportingStatus = 'Actual'
SELECT SUM(CASE WHEN GovernmentAccountingConcept = 'Budgetary central government' THEN 1 ELSE 0 END), SUM(CASE WHEN GovernmentAccountingConcept = 'Consolidated central government' THEN 1 ELSE 0 END) central_nums FROM country WHERE ExternalDebtReportingStatus = 'Actual'
1,742
moderate
world_development_indicators
List out the series code and country code of the poor countries that located in Latin American & Carribbean.
Latin American & Carribbean is the name of the region; poor countries refers to IncomeGroup = 'Low income';
SELECT T2.SeriesCode, T2.CountryCode FROM Country AS T1 INNER JOIN CountryNotes AS T2 ON T1.CountryCode = T2.Countrycode WHERE T1.Region = 'Latin America & Caribbean' AND t1.incomegroup = 'Low income'
4,384
moderate
world_development_indicators
What is the percentage of countries in the Middle East and North Africa that have finished reporting on their real external debt?
percentage = divide(count(countrycode where  ExternalDebtReportingStatus = 'Actual' ), count(countrycode))*100%; in the Middle East and North Africa refers to region = 'Middle East & North Africa'; have finished reporting on their real external debt refers to ExternalDebtReportingStatus = 'Actual'
SELECT CAST(SUM(CASE WHEN ExternalDebtReportingStatus = 'Actual' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(CountryCode) FROM Country WHERE region = 'Middle East & North Africa'
680
moderate