1sf/bird-sql-train-with-schema huggingface dataset:
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Give the head of the state of the country with the lowest percentage use of English as their language.
Evidence: head of the state refers to HeadOfState; lowest percentage use of English as their language refers to MIN(Percentage WHERE `Language` = 'English');
SQL: SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' ORDER BY T2.Percentage LIMIT 1
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What is the surface area of the country where Sutton Coldfield city belongs?
SQL: SELECT T1.SurfaceArea FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Sutton Coldfield'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: List down the languages of the countries that have population below 8000.
Evidence: population below 8000 refers to Population < 8000;
SQL: SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Population < 8000
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What are the official languages used in Belgium?
Evidence: official languages refers to IsOfficial = 'T'; Belgium is a name of country;
SQL: SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Belgium' AND T2.IsOfficial = 'T'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Give the cities and district names that belong to the country with Hajastan as its local name.
SQL: SELECT T2.Name, T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LocalName = 'Hajastan'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: How many languages are used in Cyprus?
Evidence: Cyprus is a name of Country;
SQL: SELECT SUM(CASE WHEN T1.Name = 'Cyprus' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Provide the language used by the people of Belize.
Evidence: Belize is a name of country;
SQL: SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Belize'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: List down the districts belong to the country headed by Adolf Ogi.
Evidence: headed by Adolf Ogi refers to HeadOfState = 'Adolf Ogi';
SQL: SELECT T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = 'Adolf Ogi'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Who is the head of the country where Santa Catarina district belongs?
Evidence: head of the country refers to HeadOfState;
SQL: SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.District = 'Santa Catarina'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Among the countries that have GNP greater than 1500, what is the percentage of the countries have English as its language?
Evidence: 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';
SQL: 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
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: In English speaking countries, provide the difference between the number of countries with republic and constitutional monarchy as its government form.
Evidence: English speaking refers to Language = 'English' ; difference = SUBTRACT(COUNT(Language = 'English' WHERE GovernmentForm = 'Republic'), COUNT(Language = 'English' WHERE GovernmentForm = 'ConstitutionalMonarchy'));
SQL: 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'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What country declared its independence in 1994?
Evidence: declared independence in 1994 refers to IndepYear = 1994;
SQL: SELECT Name FROM Country WHERE IndepYear = 1994
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: List all the countries in Asia.
Evidence: Asia refers to Continent = 'Asia';
SQL: SELECT Name FROM Country WHERE Continent = 'Asia'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What country in Asia has the largest gross national product(GNP)?
Evidence: Asia refers to Continent = 'Asia'; largest gross national product refers to MAX(GNP);
SQL: SELECT Name FROM Country WHERE Continent = 'Asia' ORDER BY GNP DESC LIMIT 1
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: How many cities are in the Philippines?
Evidence: Philippines refers to CountryCode = 'PHL';
SQL: SELECT COUNT(ID) FROM City WHERE Name = 'PHL'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What is the local name of Ukraine that they are also known for?
Evidence: Ukraine is a name of country;
SQL: SELECT LocalName FROM Country WHERE Name = 'Ukraine'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: How many countries have Socialistic Republic form of government?
Evidence: Socialistic Republic form of government refers to GovernmentForm = 'Socialistic Republic';
SQL: SELECT COUNT(Code) FROM Country WHERE GovernmentForm = 'Socialistic Republic'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What is the official language of China?
Evidence: official language refers to IsOfficial = 'T'; China is a name of country;
SQL: SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'China' AND T2.IsOfficial = 'T'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: How many percent of the population of China used Chinese as their language?
Evidence: percent refers to Percentage; China is a name of country; use Chinese as their language refers to Language = 'Chinese';
SQL: SELECT T2.Percentage FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'China' AND T2.Language = 'Chinese'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What is the form of government that the city of Manila has?
Evidence: form of government refers to GovernmentForm;
SQL: SELECT T1.GovernmentForm FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Manila'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What is the capital city of the Philippines?
Evidence: capital city refers to Capital; Philippines is a name of country;
SQL: SELECT T1.Capital FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Philipiines'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: List all the languages used in Europe.
Evidence: Europe refers to Continent = 'Europe';
SQL: SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = 'Europe'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Who is the head of state of the country where the city of Pyongyang is under?
SQL: SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Pyongyang'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: How many unofficial languages are used in Italy?
Evidence: unofficial languages refers to IsOfficial = 'F'; Italy is a name of country;
SQL: SELECT SUM(CASE WHEN T2.IsOfficial = 'F' THEN 1 ELSE 0 END) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Italy'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What city in Russia has the least population?
Evidence: Russia is a name of country; least population refers to MIN(Population);
SQL: SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Russian Federation' ORDER BY T2.Population ASC LIMIT 1
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: List all the cities in the country where there is high life expectancy at birth.
Evidence: high life expectancy at birth refers to MAX(LifeExpectancy);
SQL: SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.LifeExpectancy DESC LIMIT 1
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: List all the official and unofficial languages used by the country that declared its independence in 1830.
Evidence: official language refers to IsOfficial = 'T'; unofficial language refers to IsOfficial = 'F'; declared independence in 1830 refers to IndepYear = 1830;
SQL: SELECT T2.Language, T2.IsOfficial FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.IndepYear = 1830 GROUP BY T2.Language, T2.IsOfficial
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What is the capital city of the country with largest population?
Evidence: capital city refers to Capital; largest population refers to MAX(Population);
SQL: SELECT T1.Capital FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population DESC LIMIT 1
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: List all the countries in the continent of Asia that use English as their unofficial language.
Evidence: use English as unofficial language refers to Language = 'English' WHERE IsOfficial = 'F';
SQL: SELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = 'Asia' AND T2.IsOfficial = 'F' GROUP BY T1.Name
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Calculate the average GNP of all countries that use Arabic language.
Evidence: average GNP = AVG(GNP); use Arabic language refers to Language = 'Arabic';
SQL: SELECT AVG(T1.GNP) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic'
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Calculate the percentage of the surface area of all countries that uses Chinese as one of their languages.
Evidence: percentage = DIVIDE(MULTIPLY(SUM(SurfaceArea WHERE Language = 'Chinese'), SUM(SurfaceArea)), 1.0); Chinese as one of the languages refers to Language = 'Chinese';
SQL: 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
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Which country has the smallest surface area?
Evidence: smallest surface area refers to MIN(smallest surface area);
SQL: SELECT Name FROM Country ORDER BY SurfaceArea ASC LIMIT 1
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: Write down the name of the largest population country.
Evidence: largest population refers to MAX(Population);
SQL: SELECT Name FROM Country ORDER BY Population DESC LIMIT 1
Database: world
Tables: City, Country, CountryLanguage
Columns (table index, column name): -1, *, 0, ID, 0, Name, 0, CountryCode, 0, District, 0, Population, 1, Code, 1, Name, 1, Continent, 1, Region, 1, SurfaceArea, 1, IndepYear, 1, Population, 1, LifeExpectancy, 1, GNP, 1, GNPOld, 1, LocalName, 1, GovernmentForm, 1, HeadOfState, 1, Capital, 1, Code2, 2, CountryCode, 2, Language, 2, IsOfficial, 2, Percentage
Question: What is the language of the smallest population country?
Evidence: smallest population refers to MIN(Population);
SQL: SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population ASC LIMIT 1