combined_text
stringlengths 106
1.05k
|
---|
###question:List the Episode of all TV series showed on TV Channel with series name "Sky Radio".###answer:SELECT T2.Episode FROM TV_Channel AS T1 JOIN TV_series AS T2 ON T1.id = T2.Channel WHERE T1.series_name = "Sky Radio"###context:CREATE TABLE TV_Channel (id VARCHAR, series_name VARCHAR); CREATE TABLE TV_series (Episode VARCHAR, Channel VARCHAR) |
###question:Find the number of cartoons directed by each of the listed directors.###answer:SELECT COUNT(*), Directed_by FROM cartoon GROUP BY Directed_by###context:CREATE TABLE cartoon (Directed_by VARCHAR) |
###question:Find the production code and channel of the most recently aired cartoon .###answer:SELECT production_code, channel FROM cartoon ORDER BY original_air_date DESC LIMIT 1###context:CREATE TABLE cartoon (production_code VARCHAR, channel VARCHAR, original_air_date VARCHAR) |
###question:Find the package choice and series name of the TV channel that has high definition TV.###answer:SELECT package_option, series_name FROM TV_Channel WHERE hight_definition_TV = "yes"###context:CREATE TABLE TV_Channel (package_option VARCHAR, series_name VARCHAR, hight_definition_TV VARCHAR) |
###question:which countries' tv channels are playing some cartoon written by Todd Casey?###answer:SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey'###context:CREATE TABLE TV_Channel (country VARCHAR, id VARCHAR); CREATE TABLE cartoon (Channel VARCHAR, written_by VARCHAR) |
###question:which countries' tv channels are not playing any cartoon written by Todd Casey?###answer:SELECT country FROM TV_Channel EXCEPT SELECT T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.written_by = 'Todd Casey'###context:CREATE TABLE TV_Channel (country VARCHAR, id VARCHAR); CREATE TABLE TV_Channel (country VARCHAR); CREATE TABLE cartoon (Channel VARCHAR, written_by VARCHAR) |
###question:Find the series name and country of the tv channel that is playing some cartoons directed by Ben Jones and Michael Chang?###answer:SELECT T1.series_name, T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Michael Chang' INTERSECT SELECT T1.series_name, T1.country FROM TV_Channel AS T1 JOIN cartoon AS T2 ON T1.id = T2.Channel WHERE T2.directed_by = 'Ben Jones'###context:CREATE TABLE TV_Channel (series_name VARCHAR, country VARCHAR, id VARCHAR); CREATE TABLE cartoon (Channel VARCHAR, directed_by VARCHAR) |
###question:find the pixel aspect ratio and nation of the tv channels that do not use English.###answer:SELECT Pixel_aspect_ratio_PAR, country FROM tv_channel WHERE LANGUAGE <> 'English'###context:CREATE TABLE tv_channel (Pixel_aspect_ratio_PAR VARCHAR, country VARCHAR, LANGUAGE VARCHAR) |
###question:find id of the tv channels that from the countries where have more than two tv channels.###answer:SELECT id FROM tv_channel GROUP BY country HAVING COUNT(*) > 2###context:CREATE TABLE tv_channel (id VARCHAR, country VARCHAR) |
###question:find the id of tv channels that do not play any cartoon directed by Ben Jones.###answer:SELECT id FROM TV_Channel EXCEPT SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones'###context:CREATE TABLE TV_Channel (id VARCHAR, channel VARCHAR, directed_by VARCHAR); CREATE TABLE cartoon (id VARCHAR, channel VARCHAR, directed_by VARCHAR) |
###question:find the package option of the tv channel that do not have any cartoon directed by Ben Jones.###answer:SELECT package_option FROM TV_Channel WHERE NOT id IN (SELECT channel FROM cartoon WHERE directed_by = 'Ben Jones')###context:CREATE TABLE cartoon (package_option VARCHAR, id VARCHAR, channel VARCHAR, directed_by VARCHAR); CREATE TABLE TV_Channel (package_option VARCHAR, id VARCHAR, channel VARCHAR, directed_by VARCHAR) |
###question:How many poker players are there?###answer:SELECT COUNT(*) FROM poker_player###context:CREATE TABLE poker_player (Id VARCHAR) |
###question:List the earnings of poker players in descending order.###answer:SELECT Earnings FROM poker_player ORDER BY Earnings DESC###context:CREATE TABLE poker_player (Earnings VARCHAR) |
###question:List the final tables made and the best finishes of poker players.###answer:SELECT Final_Table_Made, Best_Finish FROM poker_player###context:CREATE TABLE poker_player (Final_Table_Made VARCHAR, Best_Finish VARCHAR) |
###question:What is the average earnings of poker players?###answer:SELECT AVG(Earnings) FROM poker_player###context:CREATE TABLE poker_player (Earnings INTEGER) |
###question:What is the money rank of the poker player with the highest earnings?###answer:SELECT Money_Rank FROM poker_player ORDER BY Earnings DESC LIMIT 1###context:CREATE TABLE poker_player (Money_Rank VARCHAR, Earnings VARCHAR) |
###question:What is the maximum number of final tables made among poker players with earnings less than 200000?###answer:SELECT MAX(Final_Table_Made) FROM poker_player WHERE Earnings < 200000###context:CREATE TABLE poker_player (Final_Table_Made INTEGER, Earnings INTEGER) |
###question:What are the names of poker players?###answer:SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID###context:CREATE TABLE poker_player (People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) |
###question:What are the names of poker players whose earnings is higher than 300000?###answer:SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T2.Earnings > 300000###context:CREATE TABLE poker_player (People_ID VARCHAR, Earnings INTEGER); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) |
###question:List the names of poker players ordered by the final tables made in ascending order.###answer:SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Final_Table_Made###context:CREATE TABLE poker_player (People_ID VARCHAR, Final_Table_Made VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) |
###question:What is the birth date of the poker player with the lowest earnings?###answer:SELECT T1.Birth_Date FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings LIMIT 1###context:CREATE TABLE poker_player (People_ID VARCHAR, Earnings VARCHAR); CREATE TABLE people (Birth_Date VARCHAR, People_ID VARCHAR) |
###question:What is the money rank of the tallest poker player?###answer:SELECT T2.Money_Rank FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Height DESC LIMIT 1###context:CREATE TABLE people (People_ID VARCHAR, Height VARCHAR); CREATE TABLE poker_player (Money_Rank VARCHAR, People_ID VARCHAR) |
###question:What is the average earnings of poker players with height higher than 200?###answer:SELECT AVG(T2.Earnings) FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Height > 200###context:CREATE TABLE people (People_ID VARCHAR, Height INTEGER); CREATE TABLE poker_player (Earnings INTEGER, People_ID VARCHAR) |
###question:What are the names of poker players in descending order of earnings?###answer:SELECT T1.Name FROM people AS T1 JOIN poker_player AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Earnings DESC###context:CREATE TABLE poker_player (People_ID VARCHAR, Earnings VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) |
###question:What are different nationalities of people and the corresponding number of people from each nation?###answer:SELECT Nationality, COUNT(*) FROM people GROUP BY Nationality###context:CREATE TABLE people (Nationality VARCHAR) |
###question:What is the most common nationality of people?###answer:SELECT Nationality FROM people GROUP BY Nationality ORDER BY COUNT(*) DESC LIMIT 1###context:CREATE TABLE people (Nationality VARCHAR) |
###question:What are the nationalities that are shared by at least two people?###answer:SELECT Nationality FROM people GROUP BY Nationality HAVING COUNT(*) >= 2###context:CREATE TABLE people (Nationality VARCHAR) |
###question:List the names and birth dates of people in ascending alphabetical order of name.###answer:SELECT Name, Birth_Date FROM people ORDER BY Name###context:CREATE TABLE people (Name VARCHAR, Birth_Date VARCHAR) |
###question:Show names of people whose nationality is not "Russia".###answer:SELECT Name FROM people WHERE Nationality <> "Russia"###context:CREATE TABLE people (Name VARCHAR, Nationality VARCHAR) |
###question:List the names of people that are not poker players.###answer:SELECT Name FROM people WHERE NOT People_ID IN (SELECT People_ID FROM poker_player)###context:CREATE TABLE poker_player (Name VARCHAR, People_ID VARCHAR); CREATE TABLE people (Name VARCHAR, People_ID VARCHAR) |
###question:How many distinct nationalities are there?###answer:SELECT COUNT(DISTINCT Nationality) FROM people###context:CREATE TABLE people (Nationality VARCHAR) |
###question:How many states are there?###answer:SELECT COUNT(*) FROM area_code_state###context:CREATE TABLE area_code_state (Id VARCHAR) |
###question:List the contestant numbers and names, ordered by contestant name descending.###answer:SELECT contestant_number, contestant_name FROM contestants ORDER BY contestant_name DESC###context:CREATE TABLE contestants (contestant_number VARCHAR, contestant_name VARCHAR) |
###question:List the vote ids, phone numbers and states of all votes.###answer:SELECT vote_id, phone_number, state FROM votes###context:CREATE TABLE votes (vote_id VARCHAR, phone_number VARCHAR, state VARCHAR) |
###question:What are the maximum and minimum values of area codes?###answer:SELECT MAX(area_code), MIN(area_code) FROM area_code_state###context:CREATE TABLE area_code_state (area_code INTEGER) |
###question:What is last date created of votes from the state 'CA'?###answer:SELECT MAX(created) FROM votes WHERE state = 'CA'###context:CREATE TABLE votes (created INTEGER, state VARCHAR) |
###question:What are the names of the contestants whose names are not 'Jessie Alloway'###answer:SELECT contestant_name FROM contestants WHERE contestant_name <> 'Jessie Alloway'###context:CREATE TABLE contestants (contestant_name VARCHAR) |
###question:What are the distinct states and create time of all votes?###answer:SELECT DISTINCT state, created FROM votes###context:CREATE TABLE votes (state VARCHAR, created VARCHAR) |
###question:What are the contestant numbers and names of the contestants who had at least two votes?###answer:SELECT T1.contestant_number, T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number GROUP BY T1.contestant_number HAVING COUNT(*) >= 2###context:CREATE TABLE votes (contestant_number VARCHAR); CREATE TABLE contestants (contestant_number VARCHAR, contestant_name VARCHAR) |
###question:Of all the contestants who got voted, what is the contestant number and name of the contestant who got least votes?###answer:SELECT T1.contestant_number, T1.contestant_name FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number GROUP BY T1.contestant_number ORDER BY COUNT(*) LIMIT 1###context:CREATE TABLE votes (contestant_number VARCHAR); CREATE TABLE contestants (contestant_number VARCHAR, contestant_name VARCHAR) |
###question:What are the number of votes from state 'NY' or 'CA'?###answer:SELECT COUNT(*) FROM votes WHERE state = 'NY' OR state = 'CA'###context:CREATE TABLE votes (state VARCHAR) |
###question:How many contestants did not get voted?###answer:SELECT COUNT(*) FROM contestants WHERE NOT contestant_number IN (SELECT contestant_number FROM votes)###context:CREATE TABLE contestants (contestant_number VARCHAR); CREATE TABLE votes (contestant_number VARCHAR) |
###question:What is the area code in which the most voters voted?###answer:SELECT T1.area_code FROM area_code_state AS T1 JOIN votes AS T2 ON T1.state = T2.state GROUP BY T1.area_code ORDER BY COUNT(*) DESC LIMIT 1###context:CREATE TABLE area_code_state (area_code VARCHAR, state VARCHAR); CREATE TABLE votes (state VARCHAR) |
###question:What are the create dates, states, and phone numbers of the votes that were for the contestant named 'Tabatha Gehling'?###answer:SELECT T2.created, T2.state, T2.phone_number FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number WHERE T1.contestant_name = 'Tabatha Gehling'###context:CREATE TABLE contestants (contestant_number VARCHAR, contestant_name VARCHAR); CREATE TABLE votes (created VARCHAR, state VARCHAR, phone_number VARCHAR, contestant_number VARCHAR) |
###question:List the area codes in which voters voted both for the contestant 'Tabatha Gehling' and the contestant 'Kelly Clauss'.###answer:SELECT T3.area_code FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number JOIN area_code_state AS T3 ON T2.state = T3.state WHERE T1.contestant_name = 'Tabatha Gehling' INTERSECT SELECT T3.area_code FROM contestants AS T1 JOIN votes AS T2 ON T1.contestant_number = T2.contestant_number JOIN area_code_state AS T3 ON T2.state = T3.state WHERE T1.contestant_name = 'Kelly Clauss'###context:CREATE TABLE votes (contestant_number VARCHAR, state VARCHAR); CREATE TABLE contestants (contestant_number VARCHAR, contestant_name VARCHAR); CREATE TABLE area_code_state (area_code VARCHAR, state VARCHAR) |
###question:Return the names of the contestants whose names contain the substring 'Al' .###answer:SELECT contestant_name FROM contestants WHERE contestant_name LIKE "%al%"###context:CREATE TABLE contestants (contestant_name VARCHAR) |
###question:What are the names of all the countries that became independent after 1950?###answer:SELECT Name FROM country WHERE IndepYear > 1950###context:CREATE TABLE country (Name VARCHAR, IndepYear INTEGER) |
###question:How many countries have a republic as their form of government?###answer:SELECT COUNT(*) FROM country WHERE GovernmentForm = "Republic"###context:CREATE TABLE country (GovernmentForm VARCHAR) |
###question:What is the total surface area of the countries in the Caribbean region?###answer:SELECT SUM(SurfaceArea) FROM country WHERE Region = "Caribbean"###context:CREATE TABLE country (SurfaceArea INTEGER, Region VARCHAR) |
###question:Which continent is Anguilla in?###answer:SELECT Continent FROM country WHERE Name = "Anguilla"###context:CREATE TABLE country (Continent VARCHAR, Name VARCHAR) |
###question:Which region is the city Kabul located in?###answer:SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = "Kabul"###context:CREATE TABLE country (Code VARCHAR); CREATE TABLE city (CountryCode VARCHAR, Name VARCHAR) |
###question:Which language is the most popular in Aruba?###answer:SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" ORDER BY Percentage DESC LIMIT 1###context:CREATE TABLE country (Code VARCHAR, Name VARCHAR); CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR) |
###question:What are the population and life expectancies in Brazil?###answer:SELECT Population, LifeExpectancy FROM country WHERE Name = "Brazil"###context:CREATE TABLE country (Population VARCHAR, LifeExpectancy VARCHAR, Name VARCHAR) |
###question:What are the region and population of Angola?###answer:SELECT Population, Region FROM country WHERE Name = "Angola"###context:CREATE TABLE country (Population VARCHAR, Region VARCHAR, Name VARCHAR) |
###question:What is the average expected life expectancy for countries in the region of Central Africa?###answer:SELECT AVG(LifeExpectancy) FROM country WHERE Region = "Central Africa"###context:CREATE TABLE country (LifeExpectancy INTEGER, Region VARCHAR) |
###question:What is the name of country that has the shortest life expectancy in Asia?###answer:SELECT Name FROM country WHERE Continent = "Asia" ORDER BY LifeExpectancy LIMIT 1###context:CREATE TABLE country (Name VARCHAR, Continent VARCHAR, LifeExpectancy VARCHAR) |
###question:What is the total population and maximum GNP in Asia?###answer:SELECT SUM(Population), MAX(GNP) FROM country WHERE Continent = "Asia"###context:CREATE TABLE country (Population INTEGER, GNP INTEGER, Continent VARCHAR) |
###question:What is the average life expectancy in African countries that are republics?###answer:SELECT AVG(LifeExpectancy) FROM country WHERE Continent = "Africa" AND GovernmentForm = "Republic"###context:CREATE TABLE country (LifeExpectancy INTEGER, Continent VARCHAR, GovernmentForm VARCHAR) |
###question:What is the total surface area of the continents Asia and Europe?###answer:SELECT SUM(SurfaceArea) FROM country WHERE Continent = "Asia" OR Continent = "Europe"###context:CREATE TABLE country (SurfaceArea INTEGER, Continent VARCHAR) |
###question:How many people live in Gelderland district?###answer:SELECT SUM(Population) FROM city WHERE District = "Gelderland"###context:CREATE TABLE city (Population INTEGER, District VARCHAR) |
###question:What is the average GNP and total population in all nations whose government is US territory?###answer:SELECT AVG(GNP), SUM(population) FROM country WHERE GovernmentForm = "US Territory"###context:CREATE TABLE country (GNP INTEGER, population INTEGER, GovernmentForm VARCHAR) |
###question:How many unique languages are spoken in the world?###answer:SELECT COUNT(DISTINCT LANGUAGE) FROM countrylanguage###context:CREATE TABLE countrylanguage (LANGUAGE VARCHAR) |
###question:How many type of governments are in Africa?###answer:SELECT COUNT(DISTINCT GovernmentForm) FROM country WHERE Continent = "Africa"###context:CREATE TABLE country (GovernmentForm VARCHAR, Continent VARCHAR) |
###question:What is the total number of languages used in Aruba?###answer:SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba"###context:CREATE TABLE country (Code VARCHAR, Name VARCHAR); CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR) |
###question:How many official languages does Afghanistan have?###answer:SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Afghanistan" AND IsOfficial = "T"###context:CREATE TABLE country (Code VARCHAR, Name VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR) |
###question:What is name of the country that speaks the largest number of languages?###answer:SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name ORDER BY COUNT(*) DESC LIMIT 1###context:CREATE TABLE countrylanguage (CountryCode VARCHAR); CREATE TABLE country (Name VARCHAR, Code VARCHAR) |
###question:Which continent has the most diverse languages?###answer:SELECT T1.Continent FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Continent ORDER BY COUNT(*) DESC LIMIT 1###context:CREATE TABLE countrylanguage (CountryCode VARCHAR); CREATE TABLE country (Continent VARCHAR, Code VARCHAR) |
###question:How many countries speak both English and Dutch?###answer:SELECT COUNT(*) FROM (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Dutch")###context:CREATE TABLE country (Name VARCHAR, Code VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR) |
###question:What are the names of nations speak both English and French?###answer:SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "French"###context:CREATE TABLE country (Name VARCHAR, Code VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR) |
###question:What are the names of nations where both English and French are official languages?###answer:SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T" INTERSECT SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "French" AND T2.IsOfficial = "T"###context:CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR, IsOfficial VARCHAR); CREATE TABLE country (Name VARCHAR, Code VARCHAR) |
###question:What is the number of distinct continents where Chinese is spoken?###answer:SELECT COUNT(DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Chinese"###context:CREATE TABLE country (Code VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR) |
###question:What are the regions that use English or Dutch?###answer:SELECT DISTINCT T1.Region FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" OR T2.Language = "Dutch"###context:CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR); CREATE TABLE country (Region VARCHAR, Code VARCHAR) |
###question:What are the countries where either English or Dutch is the official language ?###answer:SELECT t1.name FROM country AS t1 JOIN countrylanguage AS t2 ON t1.code = t2.countrycode WHERE t2.language = "english" AND isofficial = "t" UNION SELECT t1.name FROM country AS t1 JOIN countrylanguage AS t2 ON t1.code = t2.countrycode WHERE t2.language = "dutch" AND isofficial = "t"###context:CREATE TABLE countrylanguage (countrycode VARCHAR, language VARCHAR); CREATE TABLE country (name VARCHAR, code VARCHAR) |
###question:Which countries have either English or Dutch as an official language?###answer:SELECT * FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND IsOfficial = "T" UNION SELECT * FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Dutch" AND IsOfficial = "T"###context:CREATE TABLE country (Code VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR) |
###question:Which language is the most popular on the Asian continent?###answer:SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Continent = "Asia" GROUP BY T2.Language ORDER BY COUNT(*) DESC LIMIT 1###context:CREATE TABLE country (Code VARCHAR, Continent VARCHAR); CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR) |
###question:Which languages are spoken by only one country in republic governments?###answer:SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.GovernmentForm = "Republic" GROUP BY T2.Language HAVING COUNT(*) = 1###context:CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR); CREATE TABLE country (Code VARCHAR, GovernmentForm VARCHAR) |
###question:Find the city with the largest population that uses English.###answer:SELECT T1.Name, T1.Population FROM city AS T1 JOIN countrylanguage AS T2 ON T1.CountryCode = T2.CountryCode WHERE T2.Language = "English" ORDER BY T1.Population DESC LIMIT 1###context:CREATE TABLE city (Name VARCHAR, Population VARCHAR, CountryCode VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR) |
###question:Find the name, population and expected life length of asian country with the largest area?###answer:SELECT Name, Population, LifeExpectancy FROM country WHERE Continent = "Asia" ORDER BY SurfaceArea DESC LIMIT 1###context:CREATE TABLE country (Name VARCHAR, Population VARCHAR, LifeExpectancy VARCHAR, Continent VARCHAR, SurfaceArea VARCHAR) |
###question:What is average life expectancy in the countries where English is not the official language?###answer:SELECT AVG(LifeExpectancy) FROM country WHERE NOT Name IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English" AND T2.IsOfficial = "T")###context:CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR, IsOfficial VARCHAR); CREATE TABLE country (LifeExpectancy INTEGER, Name VARCHAR); CREATE TABLE country (Name VARCHAR, Code VARCHAR) |
###question:What is the total number of people living in the nations that do not use English?###answer:SELECT SUM(Population) FROM country WHERE NOT Name IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English")###context:CREATE TABLE country (Name VARCHAR, Code VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR, Language VARCHAR); CREATE TABLE country (Population INTEGER, Name VARCHAR) |
###question:What is the official language spoken in the country whose head of state is Beatrix?###answer:SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = "Beatrix" AND T2.IsOfficial = "T"###context:CREATE TABLE country (Code VARCHAR, HeadOfState VARCHAR); CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR, IsOfficial VARCHAR) |
###question:What is the total number of unique official languages spoken in the countries that are founded before 1930?###answer:SELECT COUNT(DISTINCT T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE IndepYear < 1930 AND T2.IsOfficial = "T"###context:CREATE TABLE country (Code VARCHAR); CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR, IsOfficial VARCHAR) |
###question:What are the countries that have greater surface area than any country in Europe?###answer:SELECT Name FROM country WHERE SurfaceArea > (SELECT MIN(SurfaceArea) FROM country WHERE Continent = "Europe")###context:CREATE TABLE country (Name VARCHAR, SurfaceArea INTEGER, Continent VARCHAR) |
###question:What are the African countries that have a population less than any country in Asia?###answer:SELECT Name FROM country WHERE Continent = "Africa" AND population < (SELECT MAX(population) FROM country WHERE Continent = "Asia")###context:CREATE TABLE country (Name VARCHAR, Continent VARCHAR, population INTEGER) |
###question:Which African countries have a smaller population than that of any country in Asia?###answer:SELECT Name FROM country WHERE Continent = "Africa" AND population < (SELECT MIN(population) FROM country WHERE Continent = "Asia")###context:CREATE TABLE country (Name VARCHAR, Continent VARCHAR, population INTEGER) |
###question:Which Asian countries have a population that is larger than any country in Africa?###answer:SELECT Name FROM country WHERE Continent = "Asia" AND population > (SELECT MAX(population) FROM country WHERE Continent = "Africa")###context:CREATE TABLE country (Name VARCHAR, Continent VARCHAR, population INTEGER) |
###question:What are the Asian countries which have a population larger than that of any country in Africa?###answer:SELECT Name FROM country WHERE Continent = "Asia" AND population > (SELECT MIN(population) FROM country WHERE Continent = "Africa")###context:CREATE TABLE country (Name VARCHAR, Continent VARCHAR, population INTEGER) |
###question:What are the country codes for countries that do not speak English?###answer:SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English"###context:CREATE TABLE countrylanguage (CountryCode VARCHAR, LANGUAGE VARCHAR) |
###question:What are the country codes of countries where people use languages other than English?###answer:SELECT DISTINCT CountryCode FROM countrylanguage WHERE LANGUAGE <> "English"###context:CREATE TABLE countrylanguage (CountryCode VARCHAR, LANGUAGE VARCHAR) |
###question:What are the codes of the countries that do not speak English and whose government forms are not Republic?###answer:SELECT Code FROM country WHERE GovernmentForm <> "Republic" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English"###context:CREATE TABLE countrylanguage (Code VARCHAR, CountryCode VARCHAR, GovernmentForm VARCHAR, LANGUAGE VARCHAR); CREATE TABLE country (Code VARCHAR, CountryCode VARCHAR, GovernmentForm VARCHAR, LANGUAGE VARCHAR) |
###question:Which cities are in European countries where English is not the official language?###answer:SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode = T1.Code WHERE T1.Continent = 'Europe' AND NOT T1.Name IN (SELECT T3.Name FROM country AS T3 JOIN countrylanguage AS T4 ON T3.Code = T4.CountryCode WHERE T4.IsOfficial = 'T' AND T4.Language = 'English')###context:CREATE TABLE city (Name VARCHAR, CountryCode VARCHAR); CREATE TABLE country (Name VARCHAR, Code VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR, IsOfficial VARCHAR, Language VARCHAR); CREATE TABLE country (Code VARCHAR, Continent VARCHAR, Name VARCHAR) |
###question:Which unique cities are in Asian countries where Chinese is the official language ?###answer:SELECT DISTINCT t3.name FROM country AS t1 JOIN countrylanguage AS t2 ON t1.code = t2.countrycode JOIN city AS t3 ON t1.code = t3.countrycode WHERE t2.isofficial = 't' AND t2.language = 'chinese' AND t1.continent = "asia"###context:CREATE TABLE city (name VARCHAR, countrycode VARCHAR); CREATE TABLE countrylanguage (countrycode VARCHAR, isofficial VARCHAR, language VARCHAR); CREATE TABLE country (code VARCHAR, continent VARCHAR) |
###question:Return the different names of cities that are in Asia and for which Chinese is the official language.###answer:SELECT DISTINCT T3.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode JOIN city AS T3 ON T1.Code = T3.CountryCode WHERE T2.IsOfficial = 'T' AND T2.Language = 'Chinese' AND T1.Continent = "Asia"###context:CREATE TABLE country (Code VARCHAR, Continent VARCHAR); CREATE TABLE countrylanguage (CountryCode VARCHAR, IsOfficial VARCHAR, Language VARCHAR); CREATE TABLE city (Name VARCHAR, CountryCode VARCHAR) |
###question:What are the name, independence year, and surface area of the country with the smallest population?###answer:SELECT Name, SurfaceArea, IndepYear FROM country ORDER BY Population LIMIT 1###context:CREATE TABLE country (Name VARCHAR, SurfaceArea VARCHAR, IndepYear VARCHAR, Population VARCHAR) |
###question:What are the population, name and leader of the country with the largest area?###answer:SELECT Name, population, HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1###context:CREATE TABLE country (Name VARCHAR, population VARCHAR, HeadOfState VARCHAR, SurfaceArea VARCHAR) |
###question:Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages.###answer:SELECT COUNT(T2.Language), T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode GROUP BY T1.Name HAVING COUNT(*) > 2###context:CREATE TABLE country (Name VARCHAR, Code VARCHAR); CREATE TABLE countrylanguage (Language VARCHAR, CountryCode VARCHAR) |
###question:Find the number of cities in each district whose population is greater than the average population of cities?###answer:SELECT COUNT(*), District FROM city WHERE Population > (SELECT AVG(Population) FROM city) GROUP BY District###context:CREATE TABLE city (District VARCHAR, Population INTEGER) |
###question:Find the government form name and total population for each government form whose average life expectancy is longer than 72.###answer:SELECT SUM(Population), GovernmentForm FROM country GROUP BY GovernmentForm HAVING AVG(LifeExpectancy) > 72###context:CREATE TABLE country (GovernmentForm VARCHAR, Population INTEGER, LifeExpectancy INTEGER) |
###question:Find the average life expectancy and total population for each continent where the average life expectancy is shorter than 72?###answer:SELECT SUM(Population), AVG(LifeExpectancy), Continent FROM country GROUP BY Continent HAVING AVG(LifeExpectancy) < 72###context:CREATE TABLE country (Continent VARCHAR, Population INTEGER, LifeExpectancy INTEGER) |
###question:What are the names and areas of countries with the top 5 largest area?###answer:SELECT Name, SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5###context:CREATE TABLE country (Name VARCHAR, SurfaceArea VARCHAR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.