db_id stringclasses 69 values | question stringlengths 24 325 | evidence stringlengths 0 673 | SQL stringlengths 23 804 |
|---|---|---|---|
hockey | What's the decrease rate of the game plays did David Aebischer after he got traded in 2005? | DIVIDE(SUBTRACT(SUM(GP(year = 2005), SUM(GP(year = 2006)), SUM(GP(year = 2005)) as percentage; | SELECT CAST((SUM(CASE WHEN T1.year = 2005 THEN T1.GP ELSE 0 END) - SUM(CASE WHEN T1.year = 2006 THEN T1.GP ELSE 0 END)) AS REAL) * 100 / SUM(CASE WHEN T1.year = 2005 THEN T1.GP ELSE 0 END) FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T2.firstName = 'David' AND T2.lastName = 'Aebischer' |
hockey | State the player ID and coach ID of person who have become coach after retirement. | after retirement means playerID Iis not NULL and coachID is not NULL; | SELECT playerID, coachID FROM Master WHERE playerID IS NOT NULL AND coachID IS NOT NULL |
hockey | State the player ID of player with average height of 75. | average height of 75 refers to AVG(height) = 75; | SELECT DISTINCT playerID FROM Master GROUP BY playerID HAVING AVG(height) = 75 |
hockey | Who is the heaviest player? State player ID of 5 heaviest players. | 5 heaviest players refer to MAX(weight) limit to 5 playerID; | SELECT playerID FROM Master ORDER BY weight DESC LIMIT 5 |
hockey | What is the full name of players origin from Finland? | origin from Finland refers to birthCountry = 'Finland'; | SELECT DISTINCT firstName, lastName FROM Master WHERE birthCountry = 'Finland' |
hockey | List down player ID of players who have passed away. | passed away means deathYear is not NULL; | SELECT DISTINCT playerID FROM Master WHERE deathYear IS NOT NULL AND playerID IS NOT NULL |
hockey | List down the first name of coaches who still coach after year 2000. | after year 2000 refers to year>2000; | SELECT DISTINCT T1.firstName FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year > 2000 |
hockey | What is the height and weight for coaches who have won awards in 1930? | year = 1930; | SELECT T1.height, T1.weight FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = '1930' |
hockey | How much is the total goals for player with player ID aaltoan01 and how old is this person? | total goals refer to SUM(G); how old = SUBTRACT(YEAR(CURDATE, birthYear); | SELECT SUM(T2.G), STRFTIME('%Y', CURRENT_TIMESTAMP) - T1.birthyear FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T1.playerID = 'aaltoan01' GROUP BY T1.birthyear |
hockey | Is there any coach who has not been a player before but has won award? State the ID. | coach who has not been a player means playerID is NULL and coachID is not NULL; | SELECT DISTINCT T2.coachID FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T1.playerID IS NULL |
hockey | Which player ID are left winger and weight more than 200? | left winger refers to pos = 'L'; weight>200 | SELECT DISTINCT playerID FROM Master WHERE pos LIKE '%L%' AND weight > 200 AND playerID IS NOT NULL AND pos = 'L' |
hockey | What is the total number of game played for players from USA? | game played refers to GP; from USA refers to birthCountry = 'USA'; | SELECT COUNT(T2.GP) FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T1.birthCountry = 'USA' |
hockey | Calculate the total points scored by team ID ANA and list down the coashes of the team. | points scored refers to Pts; team ID refers to tmID; | SELECT SUM(T2.Pts), T1.coachID FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T2.tmID = T1.tmID WHERE T2.tmID = 'ANA' GROUP BY T1.coachID |
hockey | In 1976, how many goals achieved by team 'BIR' in Division 'EW'? | year = 1976; BIR refers to tmID; Division 'EW' refers to divID = 'EW'; goals = G; | SELECT SUM(T2.G) FROM Teams AS T1 INNER JOIN Scoring AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.divID = 'EW' AND T1.tmID = 'BIR' AND T1.year = 1976 |
hockey | In 2010, how many loses made by team 'BOS' and how many assists were made by the players? | year = 2010; BOS refers to tmID; loses refer to L; assists refer to A; | SELECT SUM(T1.L), SUM(T2.A) FROM Teams AS T1 INNER JOIN Scoring AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.tmID = 'BOS' AND T1.year = 2010 |
hockey | What are the total weights of players for team 'ANA' as per year 1997? | ANA refers to tmID; | SELECT SUM(T1.weight) FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID WHERE T2.year = 1997 AND T2.tmID = 'ANA' |
hockey | Who is the shortest player and state the team ID of that player from 1925 to 1936. | Shortest refers to MIN(height); from 1925 to 1936 refers to year between 1925 and 1936; | SELECT T2.playerID, T2.tmID FROM ( SELECT playerID FROM Master WHERE height IS NOT NULL ORDER BY height ASC LIMIT 1 ) AS T1 INNER JOIN ( SELECT DISTINCT playerID, tmID FROM Scoring WHERE year BETWEEN 1925 AND 1936 ) AS T2 ON T1.playerID = T2.playerID |
hockey | Which team has the highest winning rate in year 2000? State the team ID and list down the birth country of it's players. | MAX(DIVIDE(COUNT(W), SUM(COUNT(W), (COUNT (L)) where year = 2000; | SELECT DISTINCT T3.tmID, T1.birthCountry FROM Master AS T1 INNER JOIN Scoring AS T2 ON T1.playerID = T2.playerID INNER JOIN ( SELECT year, tmID FROM Teams WHERE year = 2000 ORDER BY W / (W + L) DESC LIMIT 1 ) AS T3 ON T2.tmID = T3.tmID AND T2.year = T3.year |
hockey | In 1998, How many wins were made by team 'CAR' per game played? Who contributed the most goals? State the player ID. | year = 1998; wins per game played = DIVIDE(W, G); CAR refers to tmID; contributed the most goals refers to MAX(G); | SELECT CAST(T1.W AS REAL) / T1.G, T2.playerID FROM Teams AS T1 INNER JOIN Scoring AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.tmID = 'CAR' AND T1.year = 1998 GROUP BY T1.W / T1.G, T2.playerID ORDER BY SUM(T2.G) DESC LIMIT 1 |
world | Which country has the shortest life expectancy? | shortest life expectancy refers to MIN(LifeExpectancy); | SELECT Name FROM Country ORDER BY LifeExpectancy LIMIT 1 |
world | List any five countries which use English as an official language. | English as an official language refers to `Language` = 'English' AND IsOfficial = 'T'; | SELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' LIMIT 5 |
world | Calculate the average population per city in Karnataka district. | average population = AVG(Population); | SELECT AVG(Population) FROM City WHERE District = 'Karnataka' GROUP BY ID |
world | List the languages used in the USA. | USA refers to CountryCode = 'USA'; | SELECT Language FROM CountryLanguage WHERE CountryCode = 'USA' |
world | How many countries use Portuguese? | Portuguese refers to `Language` = 'Portuguese'; | SELECT SUM(CASE WHEN Language = 'Portuguese' THEN 1 ELSE 0 END) FROM CountryLanguage |
world | How many cities are there in England? | England refers to District = 'England'; | SELECT COUNT(ID) FROM City WHERE District = 'England' |
world | How many cities are there in the country with the largest surface area? | largest surface area refers to MAX(SurfaceArea); | SELECT T2.ID FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.SurfaceArea = ( SELECT MAX(SurfaceArea) FROM Country ) |
world | What is the capital city and population of San Marino? | capital city refers to Capital; San Marino is a name of country; | SELECT T1.Capital, T2.Population FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'San Marino' |
world | List the languages used in Turkmenistan. | Turkmenistan is a name of country; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Turkmenistan' |
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 |
world | List the countries and their official languages in Antarctica. | official language refers to IsOfficial = 'T'; Antarctica refers to Continent = 'Antarctica'; | SELECT T1.Name, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = 'Antarctica' AND T2.IsOfficial = 'T' |
world | List any five countries which use English as an official language. | English as an official language refers to `Language` = 'English' AND IsOfficial = 'T'; | SELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' LIMIT 5 |
world | Among the languages used in Baltic Countries, provide the languages which are used by over 80%.
| Baltic Countries refers to Region = 'Baltic Countries'; languages which are used by over 80% refers to Percentage > 80; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Region = 'Baltic Countries' AND T2.Percentage > 80 |
world | Among the languages used in Baltic Countries, provide the languages which are used by over 80%. | Baltic Countries refers to Region = 'Baltic Countries'; languages which are used by over 80% refers to Percentage > 80; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Region = 'Baltic Countries' AND T2.Percentage > 80 |
world | Provide the name, located country, and life expectancy of the most populated city | most populated city refers to MAX(Population); | SELECT T2.Name, T1.Code, T1.LifeExpectancy FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1 |
world | Describe the capital city and languages used in the country with the shortest life expectancy. | capital city refers to Capital; shortest life expectancy refers to MIN(LifeExpectancy); | SELECT 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 ORDER BY T1.LifeExpectancy LIMIT 1 |
world | Provide the country, population, capital city, and official language of the country with the smallest surface area. | capital city refers to Capital; official language refers to IsOfficial = 'T'; smallest surface area refers to MIN(SurfaceArea); | SELECT T1.Name, T1.Population, 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.SurfaceArea LIMIT 1 |
world | How many percent of countries in North America use English? | percentage = MULTIPLY(DIVIDE(COUNT(Language = 'English' WHERE Continent = 'North America'), COUNT(Language WHERE Continent = 'North America')), 1.0); North America refers to Continent = 'North America'; use English 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 |
world | List the district name of the city with the smallest population. | smallest population refers to MIN(Population); | SELECT District FROM City ORDER BY Population LIMIT 1 |
world | In which continent does the country with the smallest surface area belongs? | smallest surface area refers to MIN(smallest surface area); | SELECT Continent FROM Country ORDER BY SurfaceArea LIMIT 1 |
world | Who is the head of the state where the most crowded city belongs? | head of the state refers to HeadOfState; most crowded city refers to MAX(Population); | SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1 |
world | Among the countries that officially use the English language, what country has the highest capital? | officially use the English language refers to `Language` = 'English' AND IsOfficial = 'T'; highest capital refers to MAX(Capital); | SELECT T1.Code FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' ORDER BY T1.Capital DESC LIMIT 1 |
world | List down the cities that belong to the country with a life expectancy of 66.4. | SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LifeExpectancy = 66.4 | |
world | Give the head of the state of the country with the lowest percentage use of English as their language. | head of the state refers to HeadOfState; lowest percentage use of English as their language refers to MIN(Percentage WHERE `Language` = 'English'); | 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 |
world | What is the surface area of the country where Sutton Coldfield city belongs? | SELECT T1.SurfaceArea FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Sutton Coldfield' | |
world | List down the languages of the countries that have population below 8000. | population below 8000 refers to Population < 8000; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Population < 8000 |
world | What are the official languages used in Belgium? | official languages refers to IsOfficial = 'T'; Belgium is a name of country; | 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' |
world | Give the cities and district names that belong to the country with Hajastan as its local name. | SELECT T2.Name, T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LocalName = 'Hajastan' | |
world | How many languages are used in Cyprus? | Cyprus is a name of Country; | 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 |
world | Provide the language used by the people of Belize. | Belize is a name of country; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Belize' |
world | List down the districts belong to the country headed by Adolf Ogi. | headed by Adolf Ogi refers to HeadOfState = 'Adolf Ogi'; | SELECT T2.District FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = 'Adolf Ogi' |
world | Who is the head of the country where Santa Catarina district belongs? | head of the country refers to HeadOfState; | SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.District = 'Santa Catarina' |
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 |
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' |
world | What country declared its independence in 1994? | declared independence in 1994 refers to IndepYear = 1994; | SELECT Name FROM Country WHERE IndepYear = 1994 |
world | List all the countries in Asia. | Asia refers to Continent = 'Asia'; | SELECT Name FROM Country WHERE Continent = 'Asia' |
world | What country in Asia has the largest gross national product(GNP)? | Asia refers to Continent = 'Asia'; largest gross national product refers to MAX(GNP); | SELECT Name FROM Country WHERE Continent = 'Asia' ORDER BY GNP DESC LIMIT 1 |
world | How many cities are in the Philippines? | Philippines refers to CountryCode = 'PHL'; | SELECT COUNT(ID) FROM City WHERE Name = 'PHL' |
world | What is the local name of Ukraine that they are also known for? | Ukraine is a name of country; | SELECT LocalName FROM Country WHERE Name = 'Ukraine' |
world | How many countries have Socialistic Republic form of government? | Socialistic Republic form of government refers to GovernmentForm = 'Socialistic Republic'; | SELECT COUNT(Code) FROM Country WHERE GovernmentForm = 'Socialistic Republic' |
world | What is the official language of China? | official language refers to IsOfficial = 'T'; China is a name of country; | 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' |
world | How many percent of the population of China used Chinese as their language? | percent refers to Percentage; China is a name of country; use Chinese as their language refers to Language = 'Chinese'; | 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' |
world | What is the form of government that the city of Manila has? | form of government refers to GovernmentForm; | SELECT T1.GovernmentForm FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Manila' |
world | What is the capital city of the Philippines? | capital city refers to Capital; Philippines is a name of country; | SELECT T1.Capital FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Philipiines' |
world | List all the languages used in Europe. | Europe refers to Continent = 'Europe'; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = 'Europe' |
world | Who is the head of state of the country where the city of Pyongyang is under? | SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Pyongyang' | |
world | How many unofficial languages are used in Italy? | unofficial languages refers to IsOfficial = 'F'; Italy is a name of country; | 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' |
world | What city in Russia has the least population? | Russia is a name of country; least population refers to MIN(Population); | 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 |
world | List all the cities in the country where there is high life expectancy at birth. | high life expectancy at birth refers to MAX(LifeExpectancy); | SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.LifeExpectancy DESC LIMIT 1 |
world | List all the official and unofficial languages used by the country that declared its independence in 1830. | official language refers to IsOfficial = 'T'; unofficial language refers to IsOfficial = 'F'; declared independence in 1830 refers to IndepYear = 1830; | 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 |
world | What is the capital city of the country with largest population? | capital city refers to Capital; largest population refers to MAX(Population); | SELECT T1.Capital FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population DESC LIMIT 1 |
world | List all the countries in the continent of Asia that use English as their unofficial language. | use English as unofficial language refers to Language = 'English' WHERE IsOfficial = 'F'; | 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 |
world | Calculate the average GNP of all countries that use Arabic language. | average GNP = AVG(GNP); use Arabic language refers to Language = 'Arabic'; | SELECT AVG(T1.GNP) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic' |
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 |
world | Which country has the smallest surface area? | smallest surface area refers to MIN(smallest surface area); | SELECT Name FROM Country ORDER BY SurfaceArea ASC LIMIT 1 |
world | Write down the name of the largest population country. | largest population refers to MAX(Population); | SELECT Name FROM Country ORDER BY Population DESC LIMIT 1 |
world | What is the language of the smallest population country? | smallest population refers to MIN(Population); | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population ASC LIMIT 1 |
world | List down the name of countries whereby English is their official language. | English is the official language refers to Language = 'English' AND IsOfficial = 'T'; | SELECT T1.Name FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'English' AND T2.IsOfficial = 'T' |
world | List down the official language of the countries which declared independence after 1990, | official lanaguage refers to IsOfficial = 'T'; declared independence after 1990 refers to IndepYear > 1990; | SELECT T1.Name, T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.IndepYear > 1990 AND T2.IsOfficial = 'T' |
world | What is the percentage of English used in Australia? | English refers to Language = 'English'; Australia is a name of country; | SELECT T2.Percentage FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Australia' AND T2.Language = 'English' |
world | List down languages used in Malaysia. | Malaysia is a name of country; | SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = 'Malaysia' |
world | Which country has the most crowded city in the world? | most crowded city refers to MAX(Population); | SELECT T1.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1 |
world | What is the life expectancy of residents in the most crowded city? | most crowded city refers to MAX(Population); | SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population DESC LIMIT 1 |
world | What is the GNP of the least crowded city in the world? | least crowded city refers to MIN(Population); | SELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population ASC LIMIT 1 |
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 |
world | Which country has the smallest surface area and the most crowded city? | smallest surface area refers to MIN(smallest surface area); most crowded city refers to MAX(Population); | SELECT T2.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population DESC, T2.SurfaceArea DESC LIMIT 1 |
world | List down all cities of China. | China is a name of country; | SELECT T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Name = 'China' |
world | What are the cities for country called "´Uman" in local name. | SELECT T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.LocalName = '´Uman' | |
world | What is the average life expentancy of countries that speak Arabic? | average life expectancy = AVG(LifeExpectancy); speak Arabic refers to `Language` = 'Arabic'; | SELECT AVG(T1.LifeExpectancy) FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = 'Arabic' |
world | What is the GNP growth rate by the country of Shanghai? | GNP growth rate = DIVIDE(SUBTRACT(GNP, GNPOld), GNPOld); Shanghai is a name of city; | SELECT CAST((T1.GNP - T1.GNPOld) AS REAL) / T1.GNPOld FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = 'Shanghai' |
world | What is the district of Zaanstad? | Zaanstad is a name of city; | SELECT District FROM City WHERE name = 'Zaanstad' |
world | What city has the highest population? | highest population refers to MAX(Population); | SELECT Name FROM City ORDER BY Population DESC LIMIT 1 |
world | Provide the district of the city with a population of 201843. | SELECT District FROM City WHERE population = 201843 | |
world | What country has the largest surface area? | largest surface area refers to MAX(SurfaceArea); | SELECT Name FROM Country ORDER BY SurfaceArea DESC LIMIT 1 |
world | How many countries have a life expectancy of 75.1? | SELECT COUNT(*) FROM Country WHERE LifeExpectancy = 75.1 | |
world | What is the year of independence of Brunei? | year of independence refers to IndepYear; Brunei is a name of country; | SELECT IndepYear FROM Country WHERE Name = 'Brunei' |
world | How many countries have no GNP? | no GNP refers to GNP = 0; | SELECT COUNT(*) FROM Country WHERE GNP = 0 |
world | What is the average surface area of all countries? | average surface area = AVG(SurfaceArea); | SELECT AVG(SurfaceArea) FROM Country |
world | How many languages are there in the country where Tocantins district belongs? | SELECT COUNT(DISTINCT T2.Language) FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T1.District = 'Tocantins' | |
world | What are the districts that belong to the country with the largest surface area? | largest surface area refers to MAX(SurfaceArea); | SELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.Name = ( SELECT Name FROM Country ORDER BY SurfaceArea DESC LIMIT 1 ) |
world | How many cities are there in the country ruled by Kostis Stefanopoulos? | ruled by Kostis Stefanopoulos refers to HeadOfState = 'Kostis Stefanopoulos'; | SELECT COUNT(DISTINCT T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.HeadOfState = 'Kostis Stefanopoulos' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.