output
stringlengths 18
577
| instruction
stringlengths 16
224
| input
stringclasses 160
values |
---|---|---|
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? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT Name , SurfaceArea FROM country ORDER BY SurfaceArea DESC LIMIT 5 | Return the names and surface areas of the 5 largest countries. | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT Name FROM country ORDER BY Population DESC LIMIT 3 | What are names of countries with the top 3 largest population? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT Name FROM country ORDER BY Population DESC LIMIT 3 | Return the names of the 3 most populated countries. | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT Name FROM country ORDER BY Population ASC LIMIT 3 | What are the names of the nations with the 3 lowest populations? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT Name FROM country ORDER BY Population ASC LIMIT 3 | Return the names of the 3 countries with the fewest people. | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT count(*) FROM country WHERE continent = "Asia" | how many countries are in Asia? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT count(*) FROM country WHERE continent = "Asia" | Count the number of countries in Asia. | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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. | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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 ? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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 . | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT name FROM city WHERE Population BETWEEN 160000 AND 900000 | What are the cities whose population is between 160000 and 900000? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
select name from city where population between 160000 and 900000 | Return the names of cities that have a population between 160000 and 900000 . | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1 | Which language is spoken by the largest number of countries? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT LANGUAGE FROM countrylanguage GROUP BY LANGUAGE ORDER BY count(*) DESC LIMIT 1 | Give the language that is spoken in the most countries. | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT LANGUAGE , CountryCode , max(Percentage) FROM countrylanguage GROUP BY CountryCode | What is the language spoken by the largest percentage of people in each country? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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. | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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? | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
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. | "Schema (values (type))": city : ID (number) , Name (text) , CountryCode (text) , District (text) , Population (number) | sqlite_sequence : name (text) , seq (text) | country : Code (text) , Name (text) , Continent (text) , Region (text) , SurfaceArea (number) , IndepYear (number) , Population (number) , LifeExpectancy (number) , GNP (number) , GNPOld (number) , LocalName (text) , GovernmentForm (text) , HeadOfState (text) , Capital (number) , Code2 (text) | countrylanguage : CountryCode (text) , Language (text) , IsOfficial (text) , Percentage (number)
"Primary Keys": city : ID | country : Code | countrylanguage : CountryCode
"Foreign Keys": city : CountryCode equals country : Code | countrylanguage : CountryCode equals country : Code |
SELECT count(*) FROM conductor | How many conductors are there? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT count(*) FROM conductor | Count the number of conductors. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Name FROM conductor ORDER BY Age ASC | List the names of conductors in ascending order of age. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Name FROM conductor ORDER BY Age ASC | What are the names of conductors, ordered by age? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Name FROM conductor WHERE Nationality != 'USA' | What are the names of conductors whose nationalities are not "USA"? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Name FROM conductor WHERE Nationality != 'USA' | Return the names of conductors that do not have the nationality "USA". | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT avg(Attendance) FROM SHOW | What is the average attendance of shows? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT avg(Attendance) FROM SHOW | Return the average attendance across all shows. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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". | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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". | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT count(DISTINCT Nationality) FROM conductor | How many different nationalities do conductors have? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT count(DISTINCT Nationality) FROM conductor | Count the number of different nationalities of conductors. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Name FROM conductor ORDER BY Year_of_Work DESC | List names of conductors in descending order of years of work. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Name FROM conductor ORDER BY Year_of_Work DESC LIMIT 1 | List the name of the conductor with the most years of work. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company | Please show the different record companies and the corresponding number of orchestras. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Record_Company , COUNT(*) FROM orchestra GROUP BY Record_Company | How many orchestras does each record company manage? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance) | List the names of orchestras that have no performance. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT Orchestra FROM orchestra WHERE Orchestra_ID NOT IN (SELECT Orchestra_ID FROM performance) | What are the orchestras that do not have any performances? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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". | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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. | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
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? | "Schema (values (type))": conductor : Conductor_ID (number) , Name (text) , Age (number) , Nationality (text) , Year_of_Work (number) | orchestra : Orchestra_ID (number) , Orchestra (text) , Conductor_ID (number) , Record_Company (text) , Year_of_Founded (number) , Major_Record_Format (text) | performance : Performance_ID (number) , Orchestra_ID (number) , Type (text) , Date (text) , Official_ratings_(millions) (number) , Weekly_rank (text) , Share (text) | show : Show_ID (number) , Performance_ID (number) , If_first_show (others) , Result (text) , Attendance (number)
"Primary Keys": conductor : Conductor_ID | orchestra : Orchestra_ID | performance : Performance_ID
"Foreign Keys": orchestra : Conductor_ID equals conductor : Conductor_ID | performance : Orchestra_ID equals orchestra : Orchestra_ID | show : Performance_ID equals performance : Performance_ID |
SELECT count(*) FROM Highschooler | How many high schoolers are there? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT count(*) FROM Highschooler | Count the number of high schoolers. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT name , grade FROM Highschooler | Show the names and grades of each high schooler. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT name , grade FROM Highschooler | What are the names and grades for each high schooler? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade FROM Highschooler | Show all the grades of the high schoolers. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade FROM Highschooler | What is the grade of each high schooler? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade FROM Highschooler WHERE name = "Kyle" | What grade is Kyle in? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade FROM Highschooler WHERE name = "Kyle" | Return the grade for the high schooler named Kyle. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT name FROM Highschooler WHERE grade = 10 | Show the names of all high schoolers in grade 10. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT name FROM Highschooler WHERE grade = 10 | What are the names of all high schoolers in grade 10? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT ID FROM Highschooler WHERE name = "Kyle" | Show the ID of the high schooler named Kyle. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT ID FROM Highschooler WHERE name = "Kyle" | What is Kyle's id? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10 | How many high schoolers are there in grade 9 or 10? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT count(*) FROM Highschooler WHERE grade = 9 OR grade = 10 | Count the number of high schoolers in grades 9 or 10. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade , count(*) FROM Highschooler GROUP BY grade | Show the number of high schoolers for each grade. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade , count(*) FROM Highschooler GROUP BY grade | How many high schoolers are in each grade? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1 | Which grade has the most high schoolers? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade FROM Highschooler GROUP BY grade ORDER BY count(*) DESC LIMIT 1 | Return the grade that has the greatest number of high schoolers. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade FROM Highschooler GROUP BY grade HAVING count(*) >= 4 | Show me all grades that have at least 4 students. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT grade FROM Highschooler GROUP BY grade HAVING count(*) >= 4 | Which grades have 4 or more high schoolers? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT student_id , count(*) FROM Friend GROUP BY student_id | Show the student IDs and numbers of friends corresponding to each. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT student_id , count(*) FROM Friend GROUP BY student_id | How many friends does each student have? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend | Show ids of all students who do not have any friends. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT id FROM Highschooler EXCEPT SELECT student_id FROM Friend | What are the ids of high school students who do not have friends? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
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. | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |
SELECT student_id FROM Friend INTERSECT SELECT liked_id FROM Likes | What are the ids of students who both have friends and are liked? | "Schema (values (type))": Highschooler : ID (number) , name (text) , grade (number) | Friend : student_id (number) , friend_id (number) | Likes : student_id (number) , liked_id (number)
"Primary Keys": Highschooler : ID | Friend : student_id | Likes : student_id
"Foreign Keys": Friend : friend_id equals Highschooler : ID | Friend : student_id equals Highschooler : ID | Likes : student_id equals Highschooler : ID | Likes : liked_id equals Highschooler : ID |