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 |
|---|---|---|---|---|---|
world_1 | SELECT Name , SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5 | What are the names and areas of countries with the top 5 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), ... | 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(... | medium |
world_1 | SELECT Name , SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5 | Return the names and surface areas of the 5 largest countries. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | SELECT Name FROM country ORDER BY Population DESC LIMIT 3 | What are names of countries with the top 3 largest 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), ... | 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(... | medium |
world_1 | SELECT Name FROM country ORDER BY Population DESC LIMIT 3 | Return the names of the 3 most populated countries. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | SELECT Name FROM country ORDER BY Population ASC LIMIT 3 | What are the names of the nations with the 3 lowest populations? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | SELECT Name FROM country ORDER BY Population ASC LIMIT 3 | Return the names of the 3 countries with the fewest people. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | SELECT count(*) FROM country WHERE continent = "Asia" | how many countries are 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), ... | 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(... | easy |
world_1 | SELECT count(*) FROM country WHERE continent = "Asia" | Count the number of countries 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), ... | 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(... | easy |
world_1 | SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000" | What are the names of the countries that are in the continent of Europe and have a population of 80000? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000" | Give the names of countries that are in Europe and have a population equal to 80000. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | select sum(population) , avg(surfacearea) from country where continent = "north america" and surfacearea > 3000 | What is the total population and average area of countries in the continent of North America whose area is bigger than 3000 ? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | hard |
world_1 | select sum(population) , avg(surfacearea) from country where continent = "north america" and surfacearea > 3000 | Give the total population and average surface area corresponding to countries in North America that have a surface area greater than 3000 . | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | hard |
world_1 | SELECT name FROM city WHERE Population BETWEEN 160000 AND 900000 | What are the cities whose population is between 160000 and 900000? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | easy |
world_1 | select name from city where population between 160000 and 900000 | Return the names of cities that have a population between 160000 and 900000 . | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | easy |
world_1 | SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1 | Which language is spoken by the largest number of countries? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | hard |
world_1 | SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1 | Give the language that is spoken in the most countries. | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | hard |
world_1 | SELECT LANGUAGE , CountryCode , max(Percentage) FROM countrylanguage GROUP BY CountryCode | What is the language spoken by the largest percentage of people in each country? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | SELECT LANGUAGE , CountryCode , max(Percentage) FROM countrylanguage GROUP BY CountryCode | What are the country codes of the different countries, and what are the languages spoken by the greatest percentage of people for each? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | SELECT count(*) , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode | What is the total number of countries where Spanish is spoken by the largest percentage of people? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | extra |
world_1 | SELECT count(*) , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode | Count the number of countries for which Spanish is the predominantly spoken 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), ... | 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(... | extra |
world_1 | SELECT CountryCode , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode | What are the codes of countries where Spanish is spoken by the largest percentage of people? | CREATE TABLE "country" ( "Code" char(3), "Name" char(52), "Continent" TEXT, "Region" char(26), "SurfaceArea" float(10,2), "IndepYear" INTEGER, "Population" INTEGER, "LifeExpectancy" float(3,1), "GNP" float(10,2), "GNPOld" float(10,2), "LocalName" char(45), "GovernmentForm" char(45), "HeadOfState" char(60), ... | 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(... | medium |
world_1 | SELECT CountryCode , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode | Return the codes of countries for which Spanish is the predominantly spoken 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), ... | 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(... | medium |
orchestra | SELECT count(*) FROM conductor | How many conductors are there? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT count(*) FROM conductor | Count the number of conductors. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Name FROM conductor ORDER BY Age ASC | List the names of conductors in ascending order of age. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Name FROM conductor ORDER BY Age ASC | What are the names of conductors, ordered by age? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Name FROM conductor WHERE Nationality != 'USA' | What are the names of conductors whose nationalities are not "USA"? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Name FROM conductor WHERE Nationality != 'USA' | Return the names of conductors that do not have the nationality "USA". | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC | What are the record companies of orchestras in descending order of years in which they were founded? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC | Return the record companies of orchestras, sorted descending by the years in which they were founded. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT avg(Attendance) FROM SHOW | What is the average attendance of shows? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT avg(Attendance) FROM SHOW | Return the average attendance across all shows. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT max(SHARE) , min(SHARE) FROM performance WHERE TYPE != "Live final" | What are the maximum and minimum share of performances whose type is not "Live final". | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT max(SHARE) , min(SHARE) FROM performance WHERE TYPE != "Live final" | Return the maximum and minimum shares for performances that do not have the type "Live final". | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT count(DISTINCT Nationality) FROM conductor | How many different nationalities do conductors have? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT count(DISTINCT Nationality) FROM conductor | Count the number of different nationalities of conductors. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Name FROM conductor ORDER BY Year_of_Work DESC | List names of conductors in descending order of years of work. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Name FROM conductor ORDER BY Year_of_Work DESC | What are the names of conductors, sorted descending by the number of years they have worked? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | easy |
orchestra | SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1 | List the name of the conductor with the most years of work. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1 | What is the name of the conductor who has worked the greatest number of years? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID | Show the names of conductors and the orchestras they have conducted. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID | What are the names of conductors as well as the corresonding orchestras that they have conducted? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1 | Show the names of conductors that have conducted more than one orchestras. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID HAVING COUNT(*) > 1 | What are the names of conductors who have conducted at more than one orchestra? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 | Show the name of the conductor that has conducted the most number of orchestras. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | extra |
orchestra | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID GROUP BY T2.Conductor_ID ORDER BY COUNT(*) DESC LIMIT 1 | What is the name of the conductor who has conducted the most orchestras? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | extra |
orchestra | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008 | Please show the name of the conductor that has conducted orchestras founded after 2008. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008 | What are the names of conductors who have conducted orchestras founded after the year 2008? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company | Please show the different record companies and the corresponding number of orchestras. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company | How many orchestras does each record company manage? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC | Please show the record formats of orchestras in ascending order of count. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC | What are the major record formats of orchestras, sorted by their frequency? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1 | List the record company shared by the most number of orchestras. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | hard |
orchestra | SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1 | What is the record company used by the greatest number of orchestras? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | hard |
orchestra | SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance) | List the names of orchestras that have no performance. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | hard |
orchestra | SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance) | What are the orchestras that do not have any performances? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | hard |
orchestra | SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003 | Show the record companies shared by orchestras founded before 2003 and after 2003. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | hard |
orchestra | SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003 | What are the record companies that are used by both orchestras founded before 2003 and those founded after 2003? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | hard |
orchestra | SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = "CD" OR Major_Record_Format = "DVD" | Find the number of orchestras whose record format is "CD" or "DVD". | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = "CD" OR Major_Record_Format = "DVD" | Count the number of orchestras that have CD or DVD as their record format. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1 | Show the years in which orchestras that have given more than one performance are founded. | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
orchestra | SELECT Year_of_Founded FROM orchestra AS T1 JOIN performance AS T2 ON T1.Orchestra_ID = T2.Orchestra_ID GROUP BY T2.Orchestra_ID HAVING COUNT(*) > 1 | What are years of founding for orchestras that have had more than a single performance? | CREATE TABLE "conductor" ( "Conductor_ID" int, "Name" text, "Age" int, "Nationality" text, "Year_of_Work" int, PRIMARY KEY ("Conductor_ID") ); CREATE TABLE "orchestra" ( "Orchestra_ID" int, "Orchestra" text, "Conductor_ID" int, "Record_Company" text, "Year_of_Founded" real, "Major_Record_Format" text, PRIMARY KEY ("Orc... | CREATE TABLE conductor (Conductor_ID INT, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT); CREATE TABLE orchestra (Orchestra_ID INT, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT); CREATE TABLE performance (Performance_ID INT, Orchestra_ID INT, Type TEXT, ... | medium |
network_1 | SELECT count(*) FROM Highschooler | How many high schoolers are there? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT count(*) FROM Highschooler | Count the number of high schoolers. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT name , grade FROM Highschooler | Show the names and grades of each high schooler. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT name , grade FROM Highschooler | What are the names and grades for each high schooler? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT grade FROM Highschooler | Show all the grades of the high schoolers. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT grade FROM Highschooler | What is the grade of each high schooler? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT grade FROM Highschooler WHERE name = "Kyle" | What grade is Kyle in? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT grade FROM Highschooler WHERE name = "Kyle" | Return the grade for the high schooler named Kyle. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT name FROM Highschooler WHERE grade = 10 | Show the names of all high schoolers in grade 10. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT name FROM Highschooler WHERE grade = 10 | What are the names of all high schoolers in grade 10? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT ID FROM Highschooler WHERE name = "Kyle" | Show the ID of the high schooler named Kyle. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT ID FROM Highschooler WHERE name = "Kyle" | What is Kyle's id? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10 | How many high schoolers are there in grade 9 or 10? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10 | Count the number of high schoolers in grades 9 or 10. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT grade , count(*) FROM Highschooler GROUP BY grade | Show the number of high schoolers for each grade. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT grade , count(*) FROM Highschooler GROUP BY grade | How many high schoolers are in each grade? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1 | Which grade has the most high schoolers? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1 | Return the grade that has the greatest number of high schoolers. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT grade FROM Highschooler GROUP BY grade HAVING count(*) >= 4 | Show me all grades that have at least 4 students. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT grade FROM Highschooler GROUP BY grade HAVING count(*) >= 4 | Which grades have 4 or more high schoolers? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | easy |
network_1 | SELECT student_id , count(*) FROM Friend GROUP BY student_id | Show the student IDs and numbers of friends corresponding to each. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT student_id , count(*) FROM Friend GROUP BY student_id | How many friends does each student have? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id | Show the names of high school students and their corresponding number of friends. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id | What are the names of the high schoolers and how many friends does each have? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | What is the name of the high schooler who has the greatest number of friends? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | extra |
network_1 | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id ORDER BY count(*) DESC LIMIT 1 | Return the name of the high school student with the most friends. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | extra |
network_1 | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 3 | Show the names of high schoolers who have at least 3 friends. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id HAVING count(*) >= 3 | What are the names of high schoolers who have 3 or more friends? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT T3.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id JOIN Highschooler AS T3 ON T1.friend_id = T3.id WHERE T2.name = "Kyle" | Show the names of all of the high schooler Kyle's friends. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT T3.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id JOIN Highschooler AS T3 ON T1.friend_id = T3.id WHERE T2.name = "Kyle" | Return the names of friends of the high school student Kyle. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" | How many friends does the high school student Kyle have? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle" | Count the number of friends Kyle has. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | medium |
network_1 | SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend | Show ids of all students who do not have any friends. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend | What are the ids of high school students who do not have friends? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id | Show names of all high school students who do not have any friends. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id | What are the names of students who have no friends? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes | Show the ids of high schoolers who have friends and are also liked by someone else. | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
network_1 | SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes | What are the ids of students who both have friends and are liked? | create table Friend( student_id int, friend_id int, primary key (student_id,friend_id), foreign key(student_id) references Highschooler(ID), foreign key (friend_id) references Highschooler(ID) ); create table Likes( student_id int, liked_id int, primary key (student_id, liked_id), foreign key (liked_i... | CREATE TABLE Highschooler (ID INT, name TEXT, grade INT); CREATE TABLE Friend (student_id INT, friend_id INT); CREATE TABLE Likes (student_id INT, liked_id INT); | hard |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.