nl stringlengths 22 185 | sql stringlengths 22 608 | db_id stringclasses 40
values | table_schema stringclasses 305
values |
|---|---|---|---|
Find the manager and sponsor for each team and order them by the car owner. | SELECT Manager , Sponsor FROM team ORDER BY Car_Owner | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}] |
Find the make that has more than one team. | SELECT make FROM team GROUP BY team HAVING count(*) > 1 | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}] |
Which make has more than one team? | SELECT make FROM team GROUP BY team HAVING count(*) > 1 | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}] |
What are the makes of the teams with car owner "Buddy Arrington"? | SELECT Make FROM team WHERE Car_Owner = "Buddy Arrington" | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}] |
Find the make of the team whose car owner is "Buddy Arrington". | SELECT Make FROM team WHERE Car_Owner = "Buddy Arrington" | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}] |
What are the maximum and minimum points of drivers. | SELECT max(Points) , min(Points) FROM driver | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Find the highest and lowest points of drivers. | SELECT max(Points) , min(Points) FROM driver | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
How many drivers have points smaller than 150? | SELECT count(*) FROM driver WHERE Points < 150 | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Count the number of drivers whose points are below 150. | SELECT count(*) FROM driver WHERE Points < 150 | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List all the driver names in ascending order of age. | SELECT Driver FROM driver ORDER BY Age ASC | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Sort the driver names by age in ascending order. | SELECT Driver FROM driver ORDER BY Age ASC | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List all the driver names in descending order of points. | SELECT Driver FROM driver ORDER BY Points DESC | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What is the list of drivers ordered by points in descending order? | SELECT Driver FROM driver ORDER BY Points DESC | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Please show the names of drivers, and countries they are from. | SELECT T2.Driver , T1.Country FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
For each driver, return his or her name and country. | SELECT T2.Driver , T1.Country FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
Show the maximum points of the drivers from countries with capital "Dublin" | SELECT max(T2.Points) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country WHERE T1.Capital = "Dublin" | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
What is the maximum points of the drivers from a country whose capital is "Dublin"? | SELECT max(T2.Points) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country WHERE T1.Capital = "Dublin" | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
What is the average age of drivers from countries with official native language "English" | SELECT avg(T2.age) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country WHERE T1.Official_native_language = "English" | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
Find the average age of the drivers from the countries that use "English" as official native language. | SELECT avg(T2.age) FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country WHERE T1.Official_native_language = "English" | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
What are the countries that have drivers with points larger than 150? | SELECT T1.Country FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country WHERE T2.Points > 150 | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
Find all the countries where some drivers have points above 150. | SELECT T1.Country FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country WHERE T2.Points > 150 | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
What is the capital of the country where the driver with the most points is from? | SELECT T1.Capital FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country ORDER BY T2.Points DESC LIMIT 1 | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
Which country is the driver with the highest points from? Give me the capital of the country. | SELECT T1.Capital FROM country AS T1 JOIN driver AS T2 ON T1.Country_ID = T2.Country ORDER BY T2.Points DESC LIMIT 1 | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
List each make with the number of drivers with that make. | SELECT Make , COUNT(*) FROM driver GROUP BY Make | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
For each make, return the make and the count of drivers with that make. | SELECT Make , COUNT(*) FROM driver GROUP BY Make | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List the make that are associated with most drivers. | SELECT Make FROM driver GROUP BY Make ORDER BY COUNT(*) DESC LIMIT 1 | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Which make does the most drivers have? | SELECT Make FROM driver GROUP BY Make ORDER BY COUNT(*) DESC LIMIT 1 | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List the driver makes that are associated with at least three drivers. | SELECT Make FROM driver GROUP BY Make HAVING COUNT(*) >= 3 | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Which make is associated with 3 or more drivers? | SELECT Make FROM driver GROUP BY Make HAVING COUNT(*) >= 3 | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
List the names of teams that do not have any drivers. | SELECT Team FROM team WHERE Team_ID NOT IN (SELECT Team_ID FROM team_driver) | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}, {'table_name': 'team driver', 'table_schema': [{'col_name': 'team id'}, {'c... |
Which team does not have drivers? | SELECT Team FROM team WHERE Team_ID NOT IN (SELECT Team_ID FROM team_driver) | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}, {'table_name': 'team driver', 'table_schema': [{'col_name': 'team id'}, {'c... |
Which country has both drivers with make "Dodge" and drivers with make "Chevrolet"? | SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country = t2.country_id WHERE t1.Make = "Dodge" INTERSECT SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country = t2.country_id WHERE t1.Make = "Chevrolet" | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
Find the countries in which there are both drivers with make "Dodge" and drivers with make "Chevrolet". | SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country = t2.country_id WHERE t1.Make = "Dodge" INTERSECT SELECT t2.country FROM driver AS t1 JOIN country AS t2 ON t1.country = t2.country_id WHERE t1.Make = "Chevrolet" | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
Show total and average points of all drivers. | SELECT sum(Points) , avg(Points) FROM driver | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
What are the total and average points of drivers? | SELECT sum(Points) , avg(Points) FROM driver | car_racing | [{'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'col_name': 'driver'}, {'col_name': 'country'}, {'col_name': 'age'}, {'col_name': 'car #'}, {'col_name': 'make'}, {'col_name': 'points'}, {'col_name': 'laps'}, {'col_name': 'winnings'}], 'foreign_key_columns': [], 'primary_keys': ['driver id']}] |
Find the countries where no driver come from. | SELECT country FROM country WHERE country_id NOT IN (SELECT country FROM driver) | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
Which countries do not have any drivers? | SELECT country FROM country WHERE country_id NOT IN (SELECT country FROM driver) | car_racing | [{'table_name': 'country', 'table_schema': [{'col_name': 'country id'}, {'col_name': 'country'}, {'col_name': 'capital'}, {'col_name': 'official native language'}, {'col_name': 'regoin'}], 'foreign_key_columns': [], 'primary_keys': ['country id']}, {'table_name': 'driver', 'table_schema': [{'col_name': 'driver id'}, {'... |
What are the manager and sponsor of the team that has the most drivers? | SELECT t1.manager , t1.sponsor FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id = t2.team_id GROUP BY t2.team_id ORDER BY count(*) DESC LIMIT 1 | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}, {'table_name': 'team driver', 'table_schema': [{'col_name': 'team id'}, {'c... |
Find the manager and sponsor of the team that has the most drivers. | SELECT t1.manager , t1.sponsor FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id = t2.team_id GROUP BY t2.team_id ORDER BY count(*) DESC LIMIT 1 | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}, {'table_name': 'team driver', 'table_schema': [{'col_name': 'team id'}, {'c... |
What are the manager and car owner of the team that has at least 2 drivers? | SELECT t1.manager , t1.car_owner FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id = t2.team_id GROUP BY t2.team_id HAVING count(*) >= 2 | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}, {'table_name': 'team driver', 'table_schema': [{'col_name': 'team id'}, {'c... |
Find the team with two or more drivers and return the the manager and car owner of the team. | SELECT t1.manager , t1.car_owner FROM team AS t1 JOIN team_driver AS t2 ON t1.team_id = t2.team_id GROUP BY t2.team_id HAVING count(*) >= 2 | car_racing | [{'table_name': 'team', 'table_schema': [{'col_name': 'team id'}, {'col_name': 'team'}, {'col_name': 'make'}, {'col_name': 'manager'}, {'col_name': 'sponsor'}, {'col_name': 'car owner'}], 'foreign_key_columns': [], 'primary_keys': ['team id']}, {'table_name': 'team driver', 'table_schema': [{'col_name': 'team id'}, {'c... |
How many institutions are there? | SELECT count(*) FROM institution | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Count the number of institutions. | SELECT count(*) FROM institution | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
List the names of institutions in ascending alphabetical order. | SELECT Name FROM institution ORDER BY Name ASC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the names of institutions, ordered alphabetically? | SELECT Name FROM institution ORDER BY Name ASC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
List the names of institutions in ascending order of founded year. | SELECT Name FROM institution ORDER BY Founded ASC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the names of institutions, ordered by the years in which they were founded? | SELECT Name FROM institution ORDER BY Founded ASC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the cities and provinces of institutions? | SELECT City , Province FROM institution | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the cities and provinces of institutions. | SELECT City , Province FROM institution | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the maximum and minimum enrollment of all institutions? | SELECT max(Enrollment) , min(Enrollment) FROM institution | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the maximum and minimum enrollment across all institutions. | SELECT max(Enrollment) , min(Enrollment) FROM institution | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the affiliations of institutions that are not in city "Vancouver"? | SELECT Affiliation FROM institution WHERE City != "Vancouver" | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the affiliations of instituions that are not in the city of Vancouver. | SELECT Affiliation FROM institution WHERE City != "Vancouver" | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the stadiums of institutions in descending order of the capacity. | SELECT Stadium FROM institution ORDER BY Capacity DESC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the stadiums of institutions, ordered by capacity descending. | SELECT Stadium FROM institution ORDER BY Capacity DESC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What is the stadium of the institution with the largest enrollment? | SELECT Stadium FROM institution ORDER BY Enrollment DESC LIMIT 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Give the stadium of the institution which is the greatest enrollment. | SELECT Stadium FROM institution ORDER BY Enrollment DESC LIMIT 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the names and nicknames of institutions? | SELECT T2.Name , T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the names of institutions, as well as their nicknames. | SELECT T2.Name , T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What is the nickname of the institution with the smallest enrollment? | SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID ORDER BY T2.Enrollment ASC LIMIT 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the nickname of the institution with the lowest enrollment. | SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID ORDER BY T2.Enrollment ASC LIMIT 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
List the names of institutions in descending order of the number of championships. | SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID ORDER BY T1.Number_of_Championships DESC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the names of institutions, ordered descending by their number of championships? | SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID ORDER BY T1.Number_of_Championships DESC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
List the names of institutions with at least one championship. | SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID WHERE T1.Number_of_Championships >= 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the names of institutions that have 1 or more championships? | SELECT T2.Name FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID WHERE T1.Number_of_Championships >= 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What is the total number of championship of institution with public affiliation? | SELECT sum(T1.Number_of_Championships) FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID WHERE T2.Affiliation = "Public" | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the total number of championships of institutions that have a Public affiliation. | SELECT sum(T1.Number_of_Championships) FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID WHERE T2.Affiliation = "Public" | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are different types of affiliations of institutions and the corresponding number of institutions? | SELECT Affiliation , COUNT(*) FROM institution GROUP BY Affiliation | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
How many institutions are there for each type of affiliation? | SELECT Affiliation , COUNT(*) FROM institution GROUP BY Affiliation | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What is the most common type of affiliation for institutions? | SELECT Affiliation FROM institution GROUP BY Affiliation ORDER BY COUNT(*) DESC LIMIT 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the most common type of affiliation across all institutions. | SELECT Affiliation FROM institution GROUP BY Affiliation ORDER BY COUNT(*) DESC LIMIT 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
In which years were more than one institution founded? | SELECT Founded , COUNT(*) FROM institution GROUP BY Founded HAVING COUNT(*) > 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return the years in which more than 1 institution was founded, as well as the number of institutions founded in each of those. | SELECT Founded , COUNT(*) FROM institution GROUP BY Founded HAVING COUNT(*) > 1 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
List the nicknames of institutions in descending order of capacity. | SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID ORDER BY T2.Capacity DESC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the nicknames of institutions, ordered descending by their capacities? | SELECT T1.Nickname FROM championship AS T1 JOIN institution AS T2 ON T1.Institution_ID = T2.Institution_ID ORDER BY T2.Capacity DESC | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the total enrollment of institutions in city `` Vancouver '' or `` Calgary '' ? | select sum(enrollment) from institution where city = "vancouver" or city = "calgary" | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Return all the enrollments of institutions in either the city of Vancouver or the city of Calgary . | select sum(enrollment) from institution where city = "vancouver" or city = "calgary" | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Show the provinces that have both institutions founded before 1920 and institutions founded after 1950. | SELECT Province FROM institution WHERE Founded < 1920 INTERSECT SELECT Province FROM institution WHERE Founded > 1950 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
What are the provinces that have not only institutions founded before 1920, but also institutions founded after 1950? | SELECT Province FROM institution WHERE Founded < 1920 INTERSECT SELECT Province FROM institution WHERE Founded > 1950 | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
How many distinct provinces are the institutions in? | SELECT count(DISTINCT Province) FROM institution | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Count the number of different provinces that have institutions. | SELECT count(DISTINCT Province) FROM institution | institution_sports | [{'table_name': 'institution', 'table_schema': [{'col_name': 'institution id'}, {'col_name': 'name'}, {'col_name': 'team'}, {'col_name': 'city'}, {'col_name': 'province'}, {'col_name': 'founded'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'endowment'}, {'col_name': 'stadium'}, {'col_name': '... |
Select all details of all warehouses. | SELECT * FROM warehouses | warehouse_1 | [{'table_name': 'warehouses', 'table_schema': [{'col_name': 'code'}, {'col_name': 'location'}, {'col_name': 'capacity'}], 'foreign_key_columns': [], 'primary_keys': ['code']}] |
What is all the information about the warehouses? | SELECT * FROM warehouses | warehouse_1 | [{'table_name': 'warehouses', 'table_schema': [{'col_name': 'code'}, {'col_name': 'location'}, {'col_name': 'capacity'}], 'foreign_key_columns': [], 'primary_keys': ['code']}] |
Find all different contents stored in New York. | SELECT DISTINCT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE LOCATION = 'New York' | warehouse_1 | [{'table_name': 'warehouses', 'table_schema': [{'col_name': 'code'}, {'col_name': 'location'}, {'col_name': 'capacity'}], 'foreign_key_columns': [], 'primary_keys': ['code']}, {'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'for... |
What are all the different contents stored in boxes in New York? | SELECT DISTINCT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE LOCATION = 'New York' | warehouse_1 | [{'table_name': 'warehouses', 'table_schema': [{'col_name': 'code'}, {'col_name': 'location'}, {'col_name': 'capacity'}], 'foreign_key_columns': [], 'primary_keys': ['code']}, {'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'for... |
Select contents of all boxes with a value larger than $150. | SELECT CONTENTS FROM boxes WHERE Value > 150 | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
What are the contents of boxes with value greater than 150? | SELECT CONTENTS FROM boxes WHERE Value > 150 | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
Select the warehouse code and the average value of the boxes in each warehouse. | SELECT warehouse , avg(value) FROM boxes GROUP BY warehouse | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
What is the average value of boxes for each warehouse? | SELECT warehouse , avg(value) FROM boxes GROUP BY warehouse | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
Find the average and total values of all boxes. | SELECT avg(value) , sum(value) FROM boxes | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
What are the average and total values across all boxes? | SELECT avg(value) , sum(value) FROM boxes | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
Find the average and total capacity of all warehouses. | SELECT avg(capacity) , sum(capacity) FROM warehouses | warehouse_1 | [{'table_name': 'warehouses', 'table_schema': [{'col_name': 'code'}, {'col_name': 'location'}, {'col_name': 'capacity'}], 'foreign_key_columns': [], 'primary_keys': ['code']}] |
What are the average and total capacities across all warehouses? | SELECT avg(capacity) , sum(capacity) FROM warehouses | warehouse_1 | [{'table_name': 'warehouses', 'table_schema': [{'col_name': 'code'}, {'col_name': 'location'}, {'col_name': 'capacity'}], 'foreign_key_columns': [], 'primary_keys': ['code']}] |
Find the average and maximum value for each different content. | SELECT avg(value) , max(value) , CONTENTS FROM boxes GROUP BY CONTENTS | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
What are the average and maximum values for each type of content in boxes? | SELECT avg(value) , max(value) , CONTENTS FROM boxes GROUP BY CONTENTS | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
Find the content that has the highest total values in all boxes. | SELECT CONTENTS FROM boxes ORDER BY value DESC LIMIT 1 | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
What is the content with the greatest value across all boxes? | SELECT CONTENTS FROM boxes ORDER BY value DESC LIMIT 1 | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
Select the average value of all the boxes. | SELECT avg(value) FROM boxes | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
What is the average value of boxes? | SELECT avg(value) FROM boxes | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
Select all distinct contents in all the boxes. | SELECT DISTINCT CONTENTS FROM boxes | warehouse_1 | [{'table_name': 'boxes', 'table_schema': [{'col_name': 'code'}, {'col_name': 'contents'}, {'col_name': 'value'}, {'col_name': 'warehouse'}], 'foreign_key_columns': ['warehouse'], 'primary_keys': ['code']}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.