problem
stringlengths
121
422
db_id
stringclasses
69 values
solution
stringlengths
23
804
Write SQL query to solve given problem: What were the penalty minutes in 1923's Stanley Cup finals of the team that ranked second in that year?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.PIM FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = '1923' AND T2.rank = 2
Write SQL query to solve given problem: Which team got the most wins in the Stanley Cup finals?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.name FROM TeamsSC AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year GROUP BY T2.name ORDER BY SUM(T1.W) DESC LIMIT 1
Write SQL query to solve given problem: How many wins did the Philadelphia Flyers have over the Boston Bruins in 1985?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.W FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.year = 1985 AND T1.tmID = ( SELECT DISTINCT tmID FROM Teams WHERE name = 'Philadelphia Flyers' ) AND T1.oppID = ( SELECT DISTINCT tmID FROM Teams WHERE name = 'Boston Bruins' )
Write SQL query to solve given problem: Please list the names of the teams that had a tie in 1909.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.name, T3.name FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Teams AS T3 ON T1.year = T3.year AND T1.oppID = T3.tmID WHERE T1.year = 1909 AND T1.T = 1
Write SQL query to solve given problem: Please list the first names of the coaches who have taught the Montreal Canadiens.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T3.firstName FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens'
Write SQL query to solve given problem: How many coaches of the Montreal Canadiens have gotten in the Hall of Fame?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT hofID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens'
Write SQL query to solve given problem: Please give the height of the tallest coach of the Montreal Canadiens.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T3.height FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens' AND T3.coachID IS NOT NULL ORDER BY T3.height DESC LIMIT 1
Write SQL query to solve given problem: Please list the first names of the coaches whose team played in 1922's Stanley Cup finals.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T3.firstName FROM Coaches AS T1 INNER JOIN TeamsSC AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.year = 1922
Write SQL query to solve given problem: Among the coaches who have taught the Philadelphia Flyers, how many of them are born in March?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT T3.coachID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Philadelphia Flyers' AND T3.birthMon = 3
Write SQL query to solve given problem: Among the coaches who are born in the USA, how many of them used to train the Philadelphia Flyers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT T3.coachID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Philadelphia Flyers' AND T3.birthCountry = 'USA'
Write SQL query to solve given problem: How many coaches who have taught the Buffalo Sabres have died?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT T3.coachID) FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Buffalo Sabres' AND T3.deathYear IS NOT NULL
Write SQL query to solve given problem: Please list the nick names of the coaches who are from the USA and have taught the Buffalo Sabres.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT nameNick FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Buffalo Sabres' AND T3.birthCountry = 'USA'
Write SQL query to solve given problem: Among the coaches who taught the teams in 1922's Stanley Cup finals, how many of them are from the USA?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT T3.coachID) FROM Coaches AS T1 INNER JOIN TeamsSC AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.year = 1922 AND T3.birthCountry = 'USA'
Write SQL query to solve given problem: In the year 2000, which team has played the most games against the Buffalo Sabres?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T3.name FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.oppID = T2.tmID INNER JOIN Teams AS T3 ON T1.year = T3.year AND T1.tmID = T3.tmID WHERE T1.year = 2000 AND T2.name = 'Buffalo Sabres' GROUP BY T3.name ORDER BY SUM(T2.G) DESC LIMIT 1
Write SQL query to solve given problem: Please list the names of all the teams that have played against the Buffalo Sabres.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T3.name FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.oppID = T2.tmID INNER JOIN Teams AS T3 ON T1.year = T3.year AND T1.tmID = T3.tmID WHERE T2.name = 'Buffalo Sabres'
Write SQL query to solve given problem: How many penalty minutes did the Montreal Canadiens have in the 1918's Stanley Cup Finals?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.PIM FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens' AND T1.year = 1918
Write SQL query to solve given problem: In the year that the Montreal Canadiens had 24 penalty minutes in the Stanley Cup finals, how many wins did the team had in total?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.W FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens' AND T2.PIM = 24
Write SQL query to solve given problem: In which year did the Montreal Canadiens have 49 penalty minutes in the Stanley Cup finals? Was it 1924, 1923 or 1918?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.year FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens' AND T2.PIM = 49
Write SQL query to solve given problem: Which coach was the first one to teach the Montreal Canadiens, please give his first name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T3.firstName FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T2.name = 'Montreal Canadiens' ORDER BY T1.year LIMIT 1
Write SQL query to solve given problem: What is the average winning rate of the Buffalo Sabres in 2000?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(CAST(T2.W AS REAL) / T2.G) / COUNT(T1.oppID) FROM TeamVsTeam AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID WHERE T2.name = 'Buffalo Sabres' AND T1.year = 2000
Write SQL query to solve given problem: How many penalty minutes did the Montreal Canadiens have on average in the Stanley Cup Finals?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT CAST(SUM(T2.PIM) AS REAL) / COUNT(T2.PIM) FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens'
Write SQL query to solve given problem: What is the average winning rate of the Montreal Canadiens in the Stanley Cup finals?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(T2.W / T2.G) / SUM(T2.G + T2.W) FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens'
Write SQL query to solve given problem: What is the percentage of American coaches among all the coaches who taught the Montreal Canadiens?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT SUM(CAST(T2.W AS REAL) / T2.G) / SUM(T2.G + T2.W) FROM Teams AS T1 INNER JOIN TeamsSC AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T1.name = 'Montreal Canadiens'
Write SQL query to solve given problem: Who was the latest non player/builder to become the hall of famer? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT name FROM HOF WHERE category IN ('Player', 'Builder') ORDER BY year DESC LIMIT 1
Write SQL query to solve given problem: For all the referees, who became a hall of famer in the 1970s? What's his hofID?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT name, hofID FROM HOF WHERE category = 'Builder' AND year BETWEEN 1970 AND 1979
Write SQL query to solve given problem: In the year 1958, what is the total number of players that became hall of famers?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(hofID) FROM HOF WHERE category = 'Player' AND year = 1958
Write SQL query to solve given problem: For the team that Scotty Bowman coached in 1982, how many bench minor penalties did they have that year?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.BenchMinor FROM Coaches AS T1 INNER JOIN Teams AS T2 ON T1.year = T2.year AND T1.tmID = T2.tmID INNER JOIN Master AS T3 ON T1.coachID = T3.coachID WHERE T3.firstName = 'Scotty' AND T3.lastName = 'Bowman' AND T1.year = 1982
Write SQL query to solve given problem: Among the players who had 10 empty net goals in their career, who is the tallest? Show his full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.firstName, T2.lastName FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.ENG = 10 ORDER BY T2.height DESC LIMIT 1
Write SQL query to solve given problem: Which was the dominant hand for the goaltender who played 32 games for QUN in 1973? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.shootCatch, T2.firstName, T2.lastName FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID AND T1.year = 1973 WHERE T1.tmID = 'QUN' AND T1.GP = 32
Write SQL query to solve given problem: For the goalkeeper that became a coach than a Hall of Famer, who played for BOS in 1972?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.firstName, T2.lastName , IIF(T1.tmID = 'BOS', 'YES', 'NO') FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 1972 AND T1.tmID = 'BOS' AND T2.coachID IS NOT NULL AND T2.hofID IS NULL
Write SQL query to solve given problem: In the history of all the Quebec Bulldogs, which goalie had the most play minutes for the team? Give the full name.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.firstName, T2.lastName FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T1.tmID = T3.tmID AND T1.year = T3.year WHERE T3.name = 'Quebec Bulldogs' AND T2.pos = 'D' GROUP BY T1.playerID, T2.firstName, T2.lastName ORDER BY SUM(T1.Min) DESC LIMIT 1
Write SQL query to solve given problem: How many goalies played for Calgary Flames?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT playerID) FROM Goalies AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.name = 'Calgary Flames'
Write SQL query to solve given problem: Which Minnesota North Stars' goalkeeper had the most Goal Againsts in his play time?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT playerID FROM Goalies AS T1 INNER JOIN Teams AS T2 ON T1.tmID = T2.tmID AND T1.year = T2.year WHERE T2.name = 'Minnesota North Stars' GROUP BY T1.playerID ORDER BY SUM(T1.GA) DESC LIMIT 1
Write SQL query to solve given problem: How many Haileybury Hockey Club goalies became a hall of famer?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT COUNT(DISTINCT T1.playerID) FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID INNER JOIN Teams AS T3 ON T1.tmID = T3.tmID AND T1.year = T3.year WHERE T3.name = 'Haileybury Hockey Club' AND T2.hofID IS NOT NULL
Write SQL query to solve given problem: For the goalie who had the most shutouts in 2010, what's his catching hand?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T2.shootCatch FROM Goalies AS T1 INNER JOIN Master AS T2 ON T1.playerID = T2.playerID WHERE T1.year = 2010 GROUP BY T2.shootCatch ORDER BY SUM(T1.SHO) DESC LIMIT 1
Write SQL query to solve given problem: What's the decrease rate of the game plays did David Aebischer after he got traded in 2005?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
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'
Write SQL query to solve given problem: State the player ID of player with average height of 75.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT playerID FROM Master GROUP BY playerID HAVING AVG(height) = 75
Write SQL query to solve given problem: Who is the heaviest player? State player ID of 5 heaviest players.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT playerID FROM Master ORDER BY weight DESC LIMIT 5
Write SQL query to solve given problem: List down the first name of coaches who still coach after year 2000.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT T1.firstName FROM Master AS T1 INNER JOIN Coaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year > 2000
Write SQL query to solve given problem: What is the height and weight for coaches who have won awards in 1930?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT T1.height, T1.weight FROM Master AS T1 INNER JOIN AwardsCoaches AS T2 ON T1.coachID = T2.coachID WHERE T2.year = '1930'
Write SQL query to solve given problem: How much is the total goals for player with player ID aaltoan01 and how old is this person?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
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
Write SQL query to solve given problem: Which player ID are left winger and weight more than 200?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
SELECT DISTINCT playerID FROM Master WHERE pos LIKE '%L%' AND weight > 200 AND playerID IS NOT NULL AND pos = 'L'
Write SQL query to solve given problem: In 1976, how many goals achieved by team 'BIR' in Division 'EW'?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
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
Write SQL query to solve given problem: In 2010, how many loses made by team 'BOS' and how many assists were made by the players?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
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
Write SQL query to solve given problem: What are the total weights of players for team 'ANA' as per year 1997?. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
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'
Write SQL query to solve given problem: Who is the shortest player and state the team ID of that player from 1925 to 1936.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
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
Write SQL query to solve given problem: Which team has the highest winning rate in year 2000? State the team ID and list down the birth country of it's players.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
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
Write SQL query to solve given problem: In 1998, How many wins were made by team 'CAR' per game played? Who contributed the most goals? State the player ID.. Keep the solution inside sql tag ```sql [SQL-Query] ```
hockey
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
Write SQL query to solve given problem: Which country has the shortest life expectancy?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT Name FROM Country ORDER BY LifeExpectancy LIMIT 1
Write SQL query to solve given problem: List any five countries which use English as an official language.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: How many countries use Portuguese?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT SUM(CASE WHEN Language = 'Portuguese' THEN 1 ELSE 0 END) FROM CountryLanguage
Write SQL query to solve given problem: Provide the name, capital city and its official language of the country with the highest life expectancy.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: List any five countries which use English as an official language.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: Among the languages used in Baltic Countries, provide the languages which are used by over 80%. . Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: Among the languages used in Baltic Countries, provide the languages which are used by over 80%.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: Provide the name, located country, and life expectancy of the most populated city. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: Describe the capital city and languages used in the country with the shortest life expectancy.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: Provide the country, population, capital city, and official language of the country with the smallest surface area.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: How many percent of countries in North America use English?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: List the district name of the city with the smallest population.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT District FROM City ORDER BY Population LIMIT 1
Write SQL query to solve given problem: In which continent does the country with the smallest surface area belongs?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT Continent FROM Country ORDER BY SurfaceArea LIMIT 1
Write SQL query to solve given problem: Who is the head of the state where the most crowded city belongs?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T1.HeadOfState FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1
Write SQL query to solve given problem: Among the countries that officially use the English language, what country has the highest capital?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: List down the cities that belong to the country with a life expectancy of 66.4.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode WHERE T1.LifeExpectancy = 66.4
Write SQL query to solve given problem: Give the head of the state of the country with the lowest percentage use of English as their language.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: List down the languages of the countries that have population below 8000.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Population < 8000
Write SQL query to solve given problem: How many languages are used in Cyprus?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: Among the countries that have GNP greater than 1500, what is the percentage of the countries have English as its language?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: What country declared its independence in 1994?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT Name FROM Country WHERE IndepYear = 1994
Write SQL query to solve given problem: What country in Asia has the largest gross national product(GNP)?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT Name FROM Country WHERE Continent = 'Asia' ORDER BY GNP DESC LIMIT 1
Write SQL query to solve given problem: How many unofficial languages are used in Italy?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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'
Write SQL query to solve given problem: What city in Russia has the least population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: List all the cities in the country where there is high life expectancy at birth.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.LifeExpectancy DESC LIMIT 1
Write SQL query to solve given problem: List all the official and unofficial languages used by the country that declared its independence in 1830.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: What is the capital city of the country with largest population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T1.Capital FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population DESC LIMIT 1
Write SQL query to solve given problem: Calculate the percentage of the surface area of all countries that uses Chinese as one of their languages.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: Which country has the smallest surface area?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT Name FROM Country ORDER BY SurfaceArea ASC LIMIT 1
Write SQL query to solve given problem: Write down the name of the largest population country.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT Name FROM Country ORDER BY Population DESC LIMIT 1
Write SQL query to solve given problem: What is the language of the smallest population country?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Language FROM Country AS T1 INNER JOIN CountryLanguage AS T2 ON T1.Code = T2.CountryCode ORDER BY T1.Population ASC LIMIT 1
Write SQL query to solve given problem: List down the official language of the countries which declared independence after 1990,. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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'
Write SQL query to solve given problem: Which country has the most crowded city in the world?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T1.Name FROM Country AS T1 INNER JOIN City AS T2 ON T1.Code = T2.CountryCode ORDER BY T2.Population DESC LIMIT 1
Write SQL query to solve given problem: What is the life expectancy of residents in the most crowded city?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.LifeExpectancy FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population DESC LIMIT 1
Write SQL query to solve given problem: What is the GNP of the least crowded city in the world?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T1.Population ASC LIMIT 1
Write SQL query to solve given problem: Within the 5 most crowded cities in the world, which country has the most languages used?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: Which country has the smallest surface area and the most crowded city?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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
Write SQL query to solve given problem: What is the district of Zaanstad?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT District FROM City WHERE name = 'Zaanstad'
Write SQL query to solve given problem: What city has the highest population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT Name FROM City ORDER BY Population DESC LIMIT 1
Write SQL query to solve given problem: Provide the district of the city with a population of 201843.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT District FROM City WHERE population = 201843
Write SQL query to solve given problem: What country has the largest surface area?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT Name FROM Country ORDER BY SurfaceArea DESC LIMIT 1
Write SQL query to solve given problem: How many countries have a life expectancy of 75.1?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT COUNT(*) FROM Country WHERE LifeExpectancy = 75.1
Write SQL query to solve given problem: How many countries have no GNP?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT COUNT(*) FROM Country WHERE GNP = 0
Write SQL query to solve given problem: What are the districts that belong to the country with the largest surface area?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
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 )
Write SQL query to solve given problem: What are the official languages used in Greece?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.IsOfficial = 'T' AND T2.name = 'Greece'
Write SQL query to solve given problem: What are the official languages of the country where you can find the city with the least population?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Language FROM City AS T1 INNER JOIN CountryLanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.IsOfficial = 'T' ORDER BY T1.Population ASC LIMIT 1
Write SQL query to solve given problem: What are the districts that belong to the country with the lowest surface area?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T1.District FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code ORDER BY T2.SurfaceArea ASC LIMIT 1
Write SQL query to solve given problem: List down the country names of countries that have a GNP lower than 1000 and have Dutch as their language.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Name FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.GNP < 1000 AND T1.IsOfficial = 'T' AND T1.Language = 'Dutch'
Write SQL query to solve given problem: What is the GNP of the country where district "Entre Rios" belongs?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.GNP FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T1.District = 'Entre Rios' LIMIT 1
Write SQL query to solve given problem: List down the cities belongs to the country that has surface area greater than 7000000.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Name, T1.Name FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea > 7000000
Write SQL query to solve given problem: How many cities are there in the country with the surface area of 652090?. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Name, COUNT(T1.Name) FROM City AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.SurfaceArea = 652090 GROUP BY T2.Name
Write SQL query to solve given problem: List down the languages of countries with an independence year between 1980 to 1995.. Keep the solution inside sql tag ```sql [SQL-Query] ```
world
SELECT T2.Name, T1.Language FROM CountryLanguage AS T1 INNER JOIN Country AS T2 ON T1.CountryCode = T2.Code WHERE T2.IndepYear BETWEEN 1980 AND 1995