db_id
stringclasses 20
values | query
stringlengths 20
422
| question
stringlengths 18
174
| create_w_keys
stringclasses 20
values | create_wo_keys
stringclasses 20
values | difficulty
stringclasses 4
values | zero_shot_request
stringlengths 527
3.32k
|
---|---|---|---|---|---|---|
voter_1 | 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' | List the area codes in which voters voted both for the contestant 'Tabatha Gehling' and the contestant 'Kelly Clauss'. | CREATE TABLE "AREA_CODE_STATE" ( "area_code" INTEGER, "state" varchar(2) PRIMARY KEY ("state"), ); CREATE TABLE "CONTESTANTS" ( "contestant_number" INTEGER, "contestant_name" varchar(50) PRIMARY KEY ("contestant_number"), ); CREATE TABLE "VOTES" ( "vote_id" INTEGER, "phone_number" INTEGER, "state" varchar(2), "contestant_number" INTEGER, "created" timestamp PRIMARY KEY ("vote_id"), FOREIGN KEY ("state") REFERENCES "AREA_CODE_STATE"("state"), FOREIGN KEY ("contestant_number") REFERENCES "CONTESTANTS"("contestant_number") ); | CREATE TABLE AREA_CODE_STATE (area_code INTEGER, state varchar(2)); CREATE TABLE CONTESTANTS (contestant_number INTEGER, contestant_name varchar(50)); CREATE TABLE VOTES (vote_id INTEGER, phone_number INTEGER, state varchar(2), contestant_number INTEGER, created timestamp); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "AREA_CODE_STATE" ( "area_code" INTEGER, "state" varchar(2) PRIMARY KEY ("state"), ); CREATE TABLE "CONTESTANTS" ( "contestant_number" INTEGER, "contestant_name" varchar(50) PRIMARY KEY ("contestant_number"), ); CREATE TABLE "VOTES" ( "vote_id" INTEGER, "phone_number" INTEGER, "state" varchar(2), "contestant_number" INTEGER, "created" timestamp PRIMARY KEY ("vote_id"), FOREIGN KEY ("state") REFERENCES "AREA_CODE_STATE"("state"), FOREIGN KEY ("contestant_number") REFERENCES "CONTESTANTS"("contestant_number") ); QUESTION: List the area codes in which voters voted both for the contestant 'Tabatha Gehling' and the contestant 'Kelly Clauss'. |
voter_1 | select contestant_name from contestants where contestant_name like "%al%" | Return the names of the contestants whose names contain the substring 'Al' . | CREATE TABLE "AREA_CODE_STATE" ( "area_code" INTEGER, "state" varchar(2) PRIMARY KEY ("state"), ); CREATE TABLE "CONTESTANTS" ( "contestant_number" INTEGER, "contestant_name" varchar(50) PRIMARY KEY ("contestant_number"), ); CREATE TABLE "VOTES" ( "vote_id" INTEGER, "phone_number" INTEGER, "state" varchar(2), "contestant_number" INTEGER, "created" timestamp PRIMARY KEY ("vote_id"), FOREIGN KEY ("state") REFERENCES "AREA_CODE_STATE"("state"), FOREIGN KEY ("contestant_number") REFERENCES "CONTESTANTS"("contestant_number") ); | CREATE TABLE AREA_CODE_STATE (area_code INTEGER, state varchar(2)); CREATE TABLE CONTESTANTS (contestant_number INTEGER, contestant_name varchar(50)); CREATE TABLE VOTES (vote_id INTEGER, phone_number INTEGER, state varchar(2), contestant_number INTEGER, created timestamp); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "AREA_CODE_STATE" ( "area_code" INTEGER, "state" varchar(2) PRIMARY KEY ("state"), ); CREATE TABLE "CONTESTANTS" ( "contestant_number" INTEGER, "contestant_name" varchar(50) PRIMARY KEY ("contestant_number"), ); CREATE TABLE "VOTES" ( "vote_id" INTEGER, "phone_number" INTEGER, "state" varchar(2), "contestant_number" INTEGER, "created" timestamp PRIMARY KEY ("vote_id"), FOREIGN KEY ("state") REFERENCES "AREA_CODE_STATE"("state"), FOREIGN KEY ("contestant_number") REFERENCES "CONTESTANTS"("contestant_number") ); QUESTION: Return the names of the contestants whose names contain the substring 'Al' . |
world_1 | SELECT Name FROM country WHERE IndepYear > 1950 | What are the names of all the countries that became independent after 1950? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the names of all the countries that became independent after 1950? |
world_1 | SELECT Name FROM country WHERE IndepYear > 1950 | Give the names of the nations that were founded after 1950. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the names of the nations that were founded after 1950. |
world_1 | SELECT count(*) FROM country WHERE GovernmentForm = "Republic" | How many countries have a republic as their form of government? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many countries have a republic as their form of government? |
world_1 | SELECT count(*) FROM country WHERE GovernmentForm = "Republic" | How many countries have governments that are republics? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many countries have governments that are republics? |
world_1 | SELECT sum(SurfaceArea) FROM country WHERE Region = "Caribbean" | What is the total surface area of the countries in the Caribbean region? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the total surface area of the countries in the Caribbean region? |
world_1 | SELECT sum(SurfaceArea) FROM country WHERE Region = "Caribbean" | How much surface area do the countires in the Carribean cover together? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How much surface area do the countires in the Carribean cover together? |
world_1 | SELECT Continent FROM country WHERE Name = "Anguilla" | Which continent is Anguilla in? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which continent is Anguilla in? |
world_1 | SELECT Continent FROM country WHERE Name = "Anguilla" | What is the continent name which Anguilla belongs to? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the continent name which Anguilla belongs to? |
world_1 | SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = "Kabul" | Which region is the city Kabul located in? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which region is the city Kabul located in? |
world_1 | SELECT Region FROM country AS T1 JOIN city AS T2 ON T1.Code = T2.CountryCode WHERE T2.Name = "Kabul" | What region is Kabul in? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What region is Kabul in? |
world_1 | 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 | Which language is the most popular in Aruba? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which language is the most popular in Aruba? |
world_1 | 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 | What language is predominantly spoken in Aruba? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What language is predominantly spoken in Aruba? |
world_1 | SELECT Population , LifeExpectancy FROM country WHERE Name = "Brazil" | What are the population and life expectancies in Brazil? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the population and life expectancies in Brazil? |
world_1 | SELECT Population , LifeExpectancy FROM country WHERE Name = "Brazil" | Give me Brazil’s population and life expectancies. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give me Brazil’s population and life expectancies. |
world_1 | SELECT Population , Region FROM country WHERE Name = "Angola" | What are the region and population of Angola? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the region and population of Angola? |
world_1 | SELECT Population , Region FROM country WHERE Name = "Angola" | What region does Angola belong to and what is its population? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What region does Angola belong to and what is its population? |
world_1 | SELECT avg(LifeExpectancy) FROM country WHERE Region = "Central Africa" | What is the average expected life expectancy for countries in the region of Central Africa? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the average expected life expectancy for countries in the region of Central Africa? |
world_1 | SELECT avg(LifeExpectancy) FROM country WHERE Region = "Central Africa" | How long is the people’s average life expectancy in Central Africa? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How long is the people’s average life expectancy in Central Africa? |
world_1 | SELECT Name FROM country WHERE Continent = "Asia" ORDER BY LifeExpectancy LIMIT 1 | What is the name of country that has the shortest life expectancy in Asia? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the name of country that has the shortest life expectancy in Asia? |
world_1 | SELECT Name FROM country WHERE Continent = "Asia" ORDER BY LifeExpectancy LIMIT 1 | Give the name of the country in Asia with the lowest life expectancy. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the name of the country in Asia with the lowest life expectancy. |
world_1 | SELECT sum(Population) , max(GNP) FROM country WHERE Continent = "Asia" | What is the total population and maximum GNP in Asia? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the total population and maximum GNP in Asia? |
world_1 | SELECT sum(Population) , max(GNP) FROM country WHERE Continent = "Asia" | How many people live in Asia, and what is the largest GNP among them? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many people live in Asia, and what is the largest GNP among them? |
world_1 | SELECT avg(LifeExpectancy) FROM country WHERE Continent = "Africa" AND GovernmentForm = "Republic" | What is the average life expectancy in African countries that are republics? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the average life expectancy in African countries that are republics? |
world_1 | SELECT avg(LifeExpectancy) FROM country WHERE Continent = "Africa" AND GovernmentForm = "Republic" | Give the average life expectancy for countries in Africa which are republics? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the average life expectancy for countries in Africa which are republics? |
world_1 | SELECT sum(SurfaceArea) FROM country WHERE Continent = "Asia" OR Continent = "Europe" | What is the total surface area of the continents Asia and Europe? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the total surface area of the continents Asia and Europe? |
world_1 | SELECT sum(SurfaceArea) FROM country WHERE Continent = "Asia" OR Continent = "Europe" | Give the total surface area covered by countries in Asia or Europe. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the total surface area covered by countries in Asia or Europe. |
world_1 | SELECT sum(Population) FROM city WHERE District = "Gelderland" | How many people live in Gelderland district? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many people live in Gelderland district? |
world_1 | SELECT sum(Population) FROM city WHERE District = "Gelderland" | What is the total population of Gelderland district? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the total population of Gelderland district? |
world_1 | SELECT avg(GNP) , sum(population) FROM country WHERE GovernmentForm = "US Territory" | What is the average GNP and total population in all nations whose government is US territory? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the average GNP and total population in all nations whose government is US territory? |
world_1 | SELECT avg(GNP) , sum(population) FROM country WHERE GovernmentForm = "US Territory" | Give the mean GNP and total population of nations which are considered US territory. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the mean GNP and total population of nations which are considered US territory. |
world_1 | SELECT count(DISTINCT LANGUAGE) FROM countrylanguage | How many unique languages are spoken in the world? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many unique languages are spoken in the world? |
world_1 | SELECT count(DISTINCT LANGUAGE) FROM countrylanguage | What is the number of distinct languages used around the world? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the number of distinct languages used around the world? |
world_1 | SELECT count(DISTINCT GovernmentForm) FROM country WHERE Continent = "Africa" | How many type of governments are in Africa? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many type of governments are in Africa? |
world_1 | SELECT count(DISTINCT GovernmentForm) FROM country WHERE Continent = "Africa" | How many different forms of governments are there in Africa? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many different forms of governments are there in Africa? |
world_1 | SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" | What is the total number of languages used in Aruba? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the total number of languages used in Aruba? |
world_1 | SELECT COUNT(T2.Language) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Aruba" | How many languages are spoken in Aruba? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many languages are spoken in Aruba? |
world_1 | SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Afghanistan" AND IsOfficial = "T" | How many official languages does Afghanistan have? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many official languages does Afghanistan have? |
world_1 | SELECT COUNT(*) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.Name = "Afghanistan" AND IsOfficial = "T" | How many official languages are spoken in Afghanistan? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many official languages are spoken in Afghanistan? |
world_1 | 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 | What is name of the country that speaks the largest number of languages? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is name of the country that speaks the largest number of languages? |
world_1 | 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 | Give the name of the nation that uses the greatest amount of languages. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the name of the nation that uses the greatest amount of languages. |
world_1 | 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 | Which continent has the most diverse languages? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which continent has the most diverse languages? |
world_1 | 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 | Which continent speaks the most languages? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which continent speaks the most languages? |
world_1 | 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") | How many countries speak both English and Dutch? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many countries speak both English and Dutch? |
world_1 | 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") | What is the number of nations that use English and Dutch? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the number of nations that use English and Dutch? |
world_1 | 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" | What are the names of nations speak both English and French? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the names of nations speak both English and French? |
world_1 | 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" | Give the names of nations that speak both English and French. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the names of nations that speak both English and French. |
world_1 | 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" | What are the names of nations where both English and French are official languages? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the names of nations where both English and French are official languages? |
world_1 | 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" | Give the names of countries with English and French as official languages. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the names of countries with English and French as official languages. |
world_1 | SELECT COUNT( DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Chinese" | What is the number of distinct continents where Chinese is spoken? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the number of distinct continents where Chinese is spoken? |
world_1 | SELECT COUNT( DISTINCT Continent) FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "Chinese" | How many continents speak Chinese? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many continents speak Chinese? |
world_1 | 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" | What are the regions that use English or Dutch? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the regions that use English or Dutch? |
world_1 | 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" | Which regions speak Dutch or English? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which regions speak Dutch or English? |
world_1 | 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" | What are the countries where either English or Dutch is the official language ? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the countries where either English or Dutch is the official language ? |
world_1 | 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" | Which countries have either English or Dutch as an official language? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which countries have either English or Dutch as an official language? |
world_1 | 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 | Which language is the most popular on the Asian continent? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which language is the most popular on the Asian continent? |
world_1 | 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 | What is the language that is used by the largest number of Asian nations? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the language that is used by the largest number of Asian nations? |
world_1 | 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 | Which languages are spoken by only one country in republic governments? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which languages are spoken by only one country in republic governments? |
world_1 | 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 | What languages are only used by a single country with a republic government? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What languages are only used by a single country with a republic government? |
world_1 | 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 | Find the city with the largest population that uses English. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Find the city with the largest population that uses English. |
world_1 | 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 | What is the most populace city that speaks English? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the most populace city that speaks English? |
world_1 | SELECT Name , Population , LifeExpectancy FROM country WHERE Continent = "Asia" ORDER BY SurfaceArea DESC LIMIT 1 | Find the name, population and expected life length of asian country with the largest area? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Find the name, population and expected life length of asian country with the largest area? |
world_1 | SELECT Name , Population , LifeExpectancy FROM country WHERE Continent = "Asia" ORDER BY SurfaceArea DESC LIMIT 1 | What are the name, population, and life expectancy of the largest Asian country by land? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the name, population, and life expectancy of the largest Asian country by land? |
world_1 | SELECT avg(LifeExpectancy) FROM country WHERE Name NOT 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") | What is average life expectancy in the countries where English is not the official language? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is average life expectancy in the countries where English is not the official language? |
world_1 | SELECT avg(LifeExpectancy) FROM country WHERE Name NOT 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") | Give the mean life expectancy of countries in which English is not the official language. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the mean life expectancy of countries in which English is not the official language. |
world_1 | SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English") | What is the total number of people living in the nations that do not use English? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the total number of people living in the nations that do not use English? |
world_1 | SELECT sum(Population) FROM country WHERE Name NOT IN (SELECT T1.Name FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T2.Language = "English") | How many people live in countries that do not speak English? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many people live in countries that do not speak English? |
world_1 | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = "Beatrix" AND T2.IsOfficial = "T" | What is the official language spoken in the country whose head of state is Beatrix? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the official language spoken in the country whose head of state is Beatrix? |
world_1 | SELECT T2.Language FROM country AS T1 JOIN countrylanguage AS T2 ON T1.Code = T2.CountryCode WHERE T1.HeadOfState = "Beatrix" AND T2.IsOfficial = "T" | What is the official language used in the country the name of whose head of state is Beatrix. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the official language used in the country the name of whose head of state is Beatrix. |
world_1 | 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" | What is the total number of unique official languages spoken in the countries that are founded before 1930? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What is the total number of unique official languages spoken in the countries that are founded before 1930? |
world_1 | 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" | For the countries founded before 1930, what is the total number of distinct official languages? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: For the countries founded before 1930, what is the total number of distinct official languages? |
world_1 | SELECT Name FROM country WHERE SurfaceArea > (SELECT min(SurfaceArea) FROM country WHERE Continent = "Europe") | What are the countries that have greater surface area than any country in Europe? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the countries that have greater surface area than any country in Europe? |
world_1 | SELECT Name FROM country WHERE SurfaceArea > (SELECT min(SurfaceArea) FROM country WHERE Continent = "Europe") | Which countries have greater area than that of any country in Europe? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which countries have greater area than that of any country in Europe? |
world_1 | SELECT Name FROM country WHERE Continent = "Africa" AND population < (SELECT max(population) FROM country WHERE Continent = "Asia") | What are the African countries that have a population less than any country in Asia? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the African countries that have a population less than any country in Asia? |
world_1 | SELECT Name FROM country WHERE Continent = "Africa" AND population < (SELECT min(population) FROM country WHERE Continent = "Asia") | Which African countries have a smaller population than that of any country in Asia? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which African countries have a smaller population than that of any country in Asia? |
world_1 | SELECT Name FROM country WHERE Continent = "Asia" AND population > (SELECT max(population) FROM country WHERE Continent = "Africa") | Which Asian countries have a population that is larger than any country in Africa? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which Asian countries have a population that is larger than any country in Africa? |
world_1 | SELECT Name FROM country WHERE Continent = "Asia" AND population > (SELECT min(population) FROM country WHERE Continent = "Africa") | What are the Asian countries which have a population larger than that of any country in Africa? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the Asian countries which have a population larger than that of any country in Africa? |
world_1 | SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" | What are the country codes for countries that do not speak English? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the country codes for countries that do not speak English? |
world_1 | SELECT CountryCode FROM countrylanguage EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" | Return the country codes for countries that do not speak English. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Return the country codes for countries that do not speak English. |
world_1 | SELECT DISTINCT CountryCode FROM countrylanguage WHERE LANGUAGE != "English" | What are the country codes of countries where people use languages other than English? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the country codes of countries where people use languages other than English? |
world_1 | SELECT DISTINCT CountryCode FROM countrylanguage WHERE LANGUAGE != "English" | Give the country codes for countries in which people speak langauges that are not English. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | easy | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the country codes for countries in which people speak langauges that are not English. |
world_1 | SELECT Code FROM country WHERE GovernmentForm != "Republic" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" | What are the codes of the countries that do not speak English and whose government forms are not Republic? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the codes of the countries that do not speak English and whose government forms are not Republic? |
world_1 | SELECT Code FROM country WHERE GovernmentForm != "Republic" EXCEPT SELECT CountryCode FROM countrylanguage WHERE LANGUAGE = "English" | Return the codes of countries that do not speak English and do not have Republics for governments. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Return the codes of countries that do not speak English and do not have Republics for governments. |
world_1 | SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode = T1.Code WHERE T1.Continent = 'Europe' AND T1.Name NOT 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') | Which cities are in European countries where English is not the official language? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which cities are in European countries where English is not the official language? |
world_1 | SELECT DISTINCT T2.Name FROM country AS T1 JOIN city AS T2 ON T2.CountryCode = T1.Code WHERE T1.Continent = 'Europe' AND T1.Name NOT 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') | What are the names of cities in Europe for which English is not the official language? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the names of cities in Europe for which English is not the official language? |
world_1 | 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" | Which unique cities are in Asian countries where Chinese is the official language ? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Which unique cities are in Asian countries where Chinese is the official language ? |
world_1 | 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" | Return the different names of cities that are in Asia and for which Chinese is the official language. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | hard | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Return the different names of cities that are in Asia and for which Chinese is the official language. |
world_1 | SELECT Name , SurfaceArea , IndepYear FROM country ORDER BY Population LIMIT 1 | What are the name, independence year, and surface area of the country with the smallest population? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the name, independence year, and surface area of the country with the smallest population? |
world_1 | SELECT Name , SurfaceArea , IndepYear FROM country ORDER BY Population LIMIT 1 | Give the name, year of independence, and surface area of the country that has the lowest population. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the name, year of independence, and surface area of the country that has the lowest population. |
world_1 | SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1 | What are the population, name and leader of the country with the largest area? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the population, name and leader of the country with the largest area? |
world_1 | SELECT Name , population , HeadOfState FROM country ORDER BY SurfaceArea DESC LIMIT 1 | Give the name, population, and head of state for the country that has the largest area. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Give the name, population, and head of state for the country that has the largest area. |
world_1 | 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 | Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Return the country name and the numbers of languages spoken for each country that speaks at least 3 languages. |
world_1 | 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 | What are the names of countries that speak more than 2 languages, as well as how many languages they speak? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the names of countries that speak more than 2 languages, as well as how many languages they speak? |
world_1 | SELECT count(*) , District FROM city WHERE Population > (SELECT avg(Population) FROM city) GROUP BY District | Find the number of cities in each district whose population is greater than the average population of cities? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Find the number of cities in each district whose population is greater than the average population of cities? |
world_1 | SELECT count(*) , District FROM city WHERE Population > (SELECT avg(Population) FROM city) GROUP BY District | How many cities in each district have a population that is above the average population across all cities? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | extra | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: How many cities in each district have a population that is above the average population across all cities? |
world_1 | SELECT sum(Population) , GovernmentForm FROM country GROUP BY GovernmentForm HAVING avg(LifeExpectancy) > 72 | Find the government form name and total population for each government form whose average life expectancy is longer than 72. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Find the government form name and total population for each government form whose average life expectancy is longer than 72. |
world_1 | SELECT sum(Population) , GovernmentForm FROM country GROUP BY GovernmentForm HAVING avg(LifeExpectancy) > 72 | What are the different government forms and what is the total population of each for government forms that have an average life expectancy greater than 72? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the different government forms and what is the total population of each for government forms that have an average life expectancy greater than 72? |
world_1 | SELECT sum(Population) , avg(LifeExpectancy) , Continent FROM country GROUP BY Continent HAVING avg(LifeExpectancy) < 72 | Find the average life expectancy and total population for each continent where the average life expectancy is shorter than 72? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: Find the average life expectancy and total population for each continent where the average life expectancy is shorter than 72? |
world_1 | SELECT sum(Population) , avg(LifeExpectancy) , Continent FROM country GROUP BY Continent HAVING avg(LifeExpectancy) < 72 | What are the different continents and the total popuation and average life expectancy corresponding to each, for continents that have an average life expectancy less than 72? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); | CREATE TABLE city (ID INTEGER, Name char(35), CountryCode char(3), District char(20), Population INTEGER); CREATE TABLE sqlite_sequence (name , seq ); CREATE TABLE country (Code char(3), Name char(52), Continent TEXT, Region char(26), SurfaceArea float(10,2), IndepYear INTEGER, Population INTEGER, LifeExpectancy float(3,1), GNP float(10,2), GNPOld float(10,2), LocalName char(45), GovernmentForm char(45), HeadOfState char(60), Capital INTEGER, Code2 char(2)); CREATE TABLE countrylanguage (CountryCode char(3), Language char(30), IsOfficial TEXT, Percentage float(4,1)); | medium | Provide the SQL query that answers the QUESTION, with no explanation or special characters. CONTEXT: Relevant SQL tables, with their properties: CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), "Capital" INTEGER, "Code2" char(2), PRIMARY KEY ("Code") ); CREATE TABLE "city" ( "ID" INTEGER, "Name" char(35), "CountryCode" char(3), "District" char(20), "Population" INTEGER PRIMARY KEY ("ID"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); ALTER TABLE "country" ADD FOREIGN KEY ("Capital") REFERENCES "city"("ID"); CREATE TABLE "countrylanguage" ( "CountryCode" char(3), "Language" char(30), "IsOfficial" TEXT, "Percentage" float(4,1) PRIMARY KEY ("CountryCode","Language"), FOREIGN KEY ("CountryCode") REFERENCES "country"("Code") ); QUESTION: What are the different continents and the total popuation and average life expectancy corresponding to each, for continents that have an average life expectancy less than 72? |