nl
stringlengths
18
174
sql
stringlengths
20
422
db_id
stringclasses
20 values
table_schema
stringclasses
90 values
What are the names and areas of countries with the top 5 largest area?
SELECT Name , SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
Return the names and surface areas of the 5 largest countries.
SELECT Name , SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
What are names of countries with the top 3 largest population?
SELECT Name FROM country ORDER BY Population DESC LIMIT 3
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
Return the names of the 3 most populated countries.
SELECT Name FROM country ORDER BY Population DESC LIMIT 3
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
What are the names of the nations with the 3 lowest populations?
SELECT Name FROM country ORDER BY Population ASC LIMIT 3
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
Return the names of the 3 countries with the fewest people.
SELECT Name FROM country ORDER BY Population ASC LIMIT 3
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
how many countries are in Asia?
SELECT count(*) FROM country WHERE continent = "Asia"
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
Count the number of countries in Asia.
SELECT count(*) FROM country WHERE continent = "Asia"
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
What are the names of the countries that are in the continent of Europe and have a population of 80000?
SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000"
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
Give the names of countries that are in Europe and have a population equal to 80000.
SELECT Name FROM country WHERE continent = "Europe" AND Population = "80000"
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
What is the total population and average area of countries in the continent of North America whose area is bigger than 3000 ?
select sum(population) , avg(surfacearea) from country where continent = "north america" and surfacearea > 3000
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
Give the total population and average surface area corresponding to countries in North America that have a surface area greater than 3000 .
select sum(population) , avg(surfacearea) from country where continent = "north america" and surfacearea > 3000
world_1
[{'table_name': 'country', 'table_schema': [{'col_name': 'code'}, {'col_name': 'name'}, {'col_name': 'continent'}, {'col_name': 'region'}, {'col_name': 'surface area'}, {'col_name': 'indepdent year'}, {'col_name': 'population'}, {'col_name': 'life expectancy'}, {'col_name': 'gnp'}, {'col_name': 'gnp old'}, {'col_name':...
What are the cities whose population is between 160000 and 900000?
SELECT name FROM city WHERE Population BETWEEN 160000 AND 900000
world_1
[{'table_name': 'city', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'country code'}, {'col_name': 'district'}, {'col_name': 'population'}], 'foreign_key_columns': ['country code'], 'primary_keys': ['id']}]
Return the names of cities that have a population between 160000 and 900000 .
select name from city where population between 160000 and 900000
world_1
[{'table_name': 'city', 'table_schema': [{'col_name': 'id'}, {'col_name': 'name'}, {'col_name': 'country code'}, {'col_name': 'district'}, {'col_name': 'population'}], 'foreign_key_columns': ['country code'], 'primary_keys': ['id']}]
Which language is spoken by the largest number of countries?
SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1
world_1
[{'table_name': 'countrylanguage', 'table_schema': [{'col_name': 'countrycode'}, {'col_name': 'language'}, {'col_name': 'is official'}, {'col_name': 'percentage'}], 'foreign_key_columns': ['countrycode'], 'primary_keys': ['countrycode']}]
Give the language that is spoken in the most countries.
SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1
world_1
[{'table_name': 'countrylanguage', 'table_schema': [{'col_name': 'countrycode'}, {'col_name': 'language'}, {'col_name': 'is official'}, {'col_name': 'percentage'}], 'foreign_key_columns': ['countrycode'], 'primary_keys': ['countrycode']}]
What is the language spoken by the largest percentage of people in each country?
SELECT LANGUAGE , CountryCode , max(Percentage) FROM countrylanguage GROUP BY CountryCode
world_1
[{'table_name': 'countrylanguage', 'table_schema': [{'col_name': 'countrycode'}, {'col_name': 'language'}, {'col_name': 'is official'}, {'col_name': 'percentage'}], 'foreign_key_columns': ['countrycode'], 'primary_keys': ['countrycode']}]
What are the country codes of the different countries, and what are the languages spoken by the greatest percentage of people for each?
SELECT LANGUAGE , CountryCode , max(Percentage) FROM countrylanguage GROUP BY CountryCode
world_1
[{'table_name': 'countrylanguage', 'table_schema': [{'col_name': 'countrycode'}, {'col_name': 'language'}, {'col_name': 'is official'}, {'col_name': 'percentage'}], 'foreign_key_columns': ['countrycode'], 'primary_keys': ['countrycode']}]
What is the total number of countries where Spanish is spoken by the largest percentage of people?
SELECT count(*) , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode
world_1
[{'table_name': 'countrylanguage', 'table_schema': [{'col_name': 'countrycode'}, {'col_name': 'language'}, {'col_name': 'is official'}, {'col_name': 'percentage'}], 'foreign_key_columns': ['countrycode'], 'primary_keys': ['countrycode']}]
Count the number of countries for which Spanish is the predominantly spoken language.
SELECT count(*) , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode
world_1
[{'table_name': 'countrylanguage', 'table_schema': [{'col_name': 'countrycode'}, {'col_name': 'language'}, {'col_name': 'is official'}, {'col_name': 'percentage'}], 'foreign_key_columns': ['countrycode'], 'primary_keys': ['countrycode']}]
What are the codes of countries where Spanish is spoken by the largest percentage of people?
SELECT CountryCode , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode
world_1
[{'table_name': 'countrylanguage', 'table_schema': [{'col_name': 'countrycode'}, {'col_name': 'language'}, {'col_name': 'is official'}, {'col_name': 'percentage'}], 'foreign_key_columns': ['countrycode'], 'primary_keys': ['countrycode']}]
Return the codes of countries for which Spanish is the predominantly spoken language.
SELECT CountryCode , max(Percentage) FROM countrylanguage WHERE LANGUAGE = "Spanish" GROUP BY CountryCode
world_1
[{'table_name': 'countrylanguage', 'table_schema': [{'col_name': 'countrycode'}, {'col_name': 'language'}, {'col_name': 'is official'}, {'col_name': 'percentage'}], 'foreign_key_columns': ['countrycode'], 'primary_keys': ['countrycode']}]
How many conductors are there?
SELECT count(*) FROM conductor
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
Count the number of conductors.
SELECT count(*) FROM conductor
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
List the names of conductors in ascending order of age.
SELECT Name FROM conductor ORDER BY Age ASC
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
What are the names of conductors, ordered by age?
SELECT Name FROM conductor ORDER BY Age ASC
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
What are the names of conductors whose nationalities are not "USA"?
SELECT Name FROM conductor WHERE Nationality != 'USA'
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
Return the names of conductors that do not have the nationality "USA".
SELECT Name FROM conductor WHERE Nationality != 'USA'
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
What are the record companies of orchestras in descending order of years in which they were founded?
SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
Return the record companies of orchestras, sorted descending by the years in which they were founded.
SELECT Record_Company FROM orchestra ORDER BY Year_of_Founded DESC
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
What is the average attendance of shows?
SELECT avg(Attendance) FROM SHOW
orchestra
[{'table_name': 'show', 'table_schema': [{'col_name': 'show id'}, {'col_name': 'performance id'}, {'col_name': 'if first show'}, {'col_name': 'result'}, {'col_name': 'attendance'}], 'foreign_key_columns': ['performance id'], 'primary_keys': []}]
Return the average attendance across all shows.
SELECT avg(Attendance) FROM SHOW
orchestra
[{'table_name': 'show', 'table_schema': [{'col_name': 'show id'}, {'col_name': 'performance id'}, {'col_name': 'if first show'}, {'col_name': 'result'}, {'col_name': 'attendance'}], 'foreign_key_columns': ['performance id'], 'primary_keys': []}]
What are the maximum and minimum share of performances whose type is not "Live final".
SELECT max(SHARE) , min(SHARE) FROM performance WHERE TYPE != "Live final"
orchestra
[{'table_name': 'performance', 'table_schema': [{'col_name': 'performance id'}, {'col_name': 'orchestra id'}, {'col_name': 'type'}, {'col_name': 'date'}, {'col_name': 'official ratings (millions)'}, {'col_name': 'weekly rank'}, {'col_name': 'share'}], 'foreign_key_columns': ['orchestra id'], 'primary_keys': ['performan...
Return the maximum and minimum shares for performances that do not have the type "Live final".
SELECT max(SHARE) , min(SHARE) FROM performance WHERE TYPE != "Live final"
orchestra
[{'table_name': 'performance', 'table_schema': [{'col_name': 'performance id'}, {'col_name': 'orchestra id'}, {'col_name': 'type'}, {'col_name': 'date'}, {'col_name': 'official ratings (millions)'}, {'col_name': 'weekly rank'}, {'col_name': 'share'}], 'foreign_key_columns': ['orchestra id'], 'primary_keys': ['performan...
How many different nationalities do conductors have?
SELECT count(DISTINCT Nationality) FROM conductor
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
Count the number of different nationalities of conductors.
SELECT count(DISTINCT Nationality) FROM conductor
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
List names of conductors in descending order of years of work.
SELECT Name FROM conductor ORDER BY Year_of_Work DESC
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
What are the names of conductors, sorted descending by the number of years they have worked?
SELECT Name FROM conductor ORDER BY Year_of_Work DESC
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
List the name of the conductor with the most years of work.
SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
What is the name of the conductor who has worked the greatest number of years?
SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}]
Show the names of conductors and the orchestras they have conducted.
SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}, {'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'co...
What are the names of conductors as well as the corresonding orchestras that they have conducted?
SELECT T1.Name , T2.Orchestra FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}, {'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'co...
Show the names of conductors that have conducted more than one orchestras.
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
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}, {'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'co...
What are the names of conductors who have conducted at more than one 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
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}, {'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'co...
Show the name of the conductor that has conducted the most number of orchestras.
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
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}, {'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'co...
What is the name of the conductor who has conducted the most orchestras?
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
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}, {'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'co...
Please show the name of the conductor that has conducted orchestras founded after 2008.
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}, {'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'co...
What are the names of conductors who have conducted orchestras founded after the year 2008?
SELECT T1.Name FROM conductor AS T1 JOIN orchestra AS T2 ON T1.Conductor_ID = T2.Conductor_ID WHERE Year_of_Founded > 2008
orchestra
[{'table_name': 'conductor', 'table_schema': [{'col_name': 'conductor id'}, {'col_name': 'name'}, {'col_name': 'age'}, {'col_name': 'nationality'}, {'col_name': 'year of work'}], 'foreign_key_columns': [], 'primary_keys': ['conductor id']}, {'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'co...
Please show the different record companies and the corresponding number of orchestras.
SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
How many orchestras does each record company manage?
SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
Please show the record formats of orchestras in ascending order of count.
SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
What are the major record formats of orchestras, sorted by their frequency?
SELECT Major_Record_Format FROM orchestra GROUP BY Major_Record_Format ORDER BY COUNT(*) ASC
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
List the record company shared by the most number of orchestras.
SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
What is the record company used by the greatest number of orchestras?
SELECT Record_Company FROM orchestra GROUP BY Record_Company ORDER BY COUNT(*) DESC LIMIT 1
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
List the names of orchestras that have no performance.
SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}, {'table_...
What are the orchestras that do not have any performances?
SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance)
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}, {'table_...
Show the record companies shared by orchestras founded before 2003 and after 2003.
SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
What are the record companies that are used by both orchestras founded before 2003 and those founded after 2003?
SELECT Record_Company FROM orchestra WHERE Year_of_Founded < 2003 INTERSECT SELECT Record_Company FROM orchestra WHERE Year_of_Founded > 2003
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
Find the number of orchestras whose record format is "CD" or "DVD".
SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = "CD" OR Major_Record_Format = "DVD"
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
Count the number of orchestras that have CD or DVD as their record format.
SELECT COUNT(*) FROM orchestra WHERE Major_Record_Format = "CD" OR Major_Record_Format = "DVD"
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}]
Show the years in which orchestras that have given more than one performance are founded.
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
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}, {'table_...
What are years of founding for orchestras that have had more than a single performance?
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
orchestra
[{'table_name': 'orchestra', 'table_schema': [{'col_name': 'orchestra id'}, {'col_name': 'orchestra'}, {'col_name': 'conductor id'}, {'col_name': 'record company'}, {'col_name': 'year of founded'}, {'col_name': 'major record format'}], 'foreign_key_columns': ['conductor id'], 'primary_keys': ['orchestra id']}, {'table_...
How many high schoolers are there?
SELECT count(*) FROM Highschooler
network_1
[]
Count the number of high schoolers.
SELECT count(*) FROM Highschooler
network_1
[]
Show the names and grades of each high schooler.
SELECT name , grade FROM Highschooler
network_1
[]
What are the names and grades for each high schooler?
SELECT name , grade FROM Highschooler
network_1
[]
Show all the grades of the high schoolers.
SELECT grade FROM Highschooler
network_1
[]
What is the grade of each high schooler?
SELECT grade FROM Highschooler
network_1
[]
What grade is Kyle in?
SELECT grade FROM Highschooler WHERE name = "Kyle"
network_1
[]
Return the grade for the high schooler named Kyle.
SELECT grade FROM Highschooler WHERE name = "Kyle"
network_1
[]
Show the names of all high schoolers in grade 10.
SELECT name FROM Highschooler WHERE grade = 10
network_1
[]
What are the names of all high schoolers in grade 10?
SELECT name FROM Highschooler WHERE grade = 10
network_1
[]
Show the ID of the high schooler named Kyle.
SELECT ID FROM Highschooler WHERE name = "Kyle"
network_1
[]
What is Kyle's id?
SELECT ID FROM Highschooler WHERE name = "Kyle"
network_1
[]
How many high schoolers are there in grade 9 or 10?
SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10
network_1
[]
Count the number of high schoolers in grades 9 or 10.
SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10
network_1
[]
Show the number of high schoolers for each grade.
SELECT grade , count(*) FROM Highschooler GROUP BY grade
network_1
[]
How many high schoolers are in each grade?
SELECT grade , count(*) FROM Highschooler GROUP BY grade
network_1
[]
Which grade has the most high schoolers?
SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1
network_1
[]
Return the grade that has the greatest number of high schoolers.
SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1
network_1
[]
Show me all grades that have at least 4 students.
SELECT grade FROM Highschooler GROUP BY grade HAVING count(*) >= 4
network_1
[]
Which grades have 4 or more high schoolers?
SELECT grade FROM Highschooler GROUP BY grade HAVING count(*) >= 4
network_1
[]
Show the student IDs and numbers of friends corresponding to each.
SELECT student_id , count(*) FROM Friend GROUP BY student_id
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
How many friends does each student have?
SELECT student_id , count(*) FROM Friend GROUP BY student_id
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Show the names of high school students and their corresponding number of friends.
SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
What are the names of the high schoolers and how many friends does each have?
SELECT T2.name , count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id GROUP BY T1.student_id
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
What is the name of the high schooler who has the greatest number of friends?
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
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Return the name of the high school student with the most friends.
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
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Show the names of high schoolers who have at least 3 friends.
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
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
What are the names of high schoolers who have 3 or more friends?
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
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Show the names of all of the high schooler Kyle's friends.
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"
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Return the names of friends of the high school student Kyle.
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"
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
How many friends does the high school student Kyle have?
SELECT count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle"
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Count the number of friends Kyle has.
SELECT count(*) FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id WHERE T2.name = "Kyle"
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Show ids of all students who do not have any friends.
SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
What are the ids of high school students who do not have friends?
SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Show names of all high school students who do not have any friends.
SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
What are the names of students who have no friends?
SELECT name FROM Highschooler EXCEPT SELECT T2.name FROM Friend AS T1 JOIN Highschooler AS T2 ON T1.student_id = T2.id
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}]
Show the ids of high schoolers who have friends and are also liked by someone else.
SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}, {'table_name': 'likes', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'liked id'}], 'foreign_key_columns': ['student id', 'l...
What are the ids of students who both have friends and are liked?
SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes
network_1
[{'table_name': 'friend', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'friend id'}], 'foreign_key_columns': ['friend id', 'student id'], 'primary_keys': ['student id']}, {'table_name': 'likes', 'table_schema': [{'col_name': 'student id'}, {'col_name': 'liked id'}], 'foreign_key_columns': ['student id', 'l...