nl
stringlengths
22
185
sql
stringlengths
22
608
db_id
stringclasses
40 values
table_schema
stringclasses
305 values
What are the different contents in 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']}]
Find the number of all distinct contents in all the boxes.
SELECT count(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']}]
How many different contents are stored in boxes?
SELECT count(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']}]
Find all distinct locations of warehouses.
SELECT count(DISTINCT LOCATION) 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 different locations of warehouses?
SELECT count(DISTINCT LOCATION) 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 code of boxes that are stored at the warehouses located at Chicago or New York.
SELECT T1.code FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location = 'Chicago' OR T2.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 the codes of boxes stored in warehouses in either Chicago or New York?
SELECT T1.code FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location = 'Chicago' OR T2.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...
Find the total value of boxes in the warehouses located at Chicago or New York.
SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location = 'Chicago' OR T2.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 is the total value of boxes located in Chicago or New York?
SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location = 'Chicago' OR T2.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...
Find all contents present in warehouses located in Chicago and those located in New York.
SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location = 'Chicago' INTERSECT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.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...
Find the contents that are stored in both Chicago and New York.
SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location = 'Chicago' INTERSECT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.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...
Find the type of contents that are not in the warehouses located at New York.
SELECT CONTENTS FROM boxes EXCEPT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.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 types of contents cannot be found in warehouses in New York?
SELECT CONTENTS FROM boxes EXCEPT SELECT T1.contents FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.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...
Find the location of the warehouses which have contents Rocks but not Scissors.
SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Rocks' EXCEPT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Scissors'
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 the locations of warehouses that have boxes containing Rocks but not Scissors?
SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Rocks' EXCEPT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Scissors'
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...
Find the warehouses which store contents Rocks or Scissors.
SELECT DISTINCT warehouse FROM boxes WHERE CONTENTS = 'Rocks' OR CONTENTS = 'Scissors'
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 distinct warehouses that have boxes with Rocks or Scissors as contents?
SELECT DISTINCT warehouse FROM boxes WHERE CONTENTS = 'Rocks' OR CONTENTS = 'Scissors'
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 location of the warehouses which store contents Rocks and Scissors.
SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Rocks' INTERSECT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Scissors'
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 the locations of warehouses in which boxes that contain Rocks and Scissors are kept?
SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Rocks' INTERSECT SELECT T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Scissors'
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...
List the code and contents of all boxes sorted by their values.
SELECT code , CONTENTS FROM boxes ORDER BY value
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 codes and corresponding contents of all the boxes, ordered by their values?
SELECT code , CONTENTS FROM boxes ORDER BY value
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 code and contents of the box with the lowest value.
SELECT code , CONTENTS FROM boxes ORDER BY value 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 code and contents for the box that has the smallest value?
SELECT code , CONTENTS FROM boxes ORDER BY value 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']}]
Find the unique contents of all boxes whose value is higher than the average value of all boxes.
SELECT DISTINCT CONTENTS FROM boxes WHERE value > (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 are the different contents of boxes for which the value is higher than the average value across all boxes?
SELECT DISTINCT CONTENTS FROM boxes WHERE value > (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']}]
List all different types of contents ordered by contents.
SELECT DISTINCT CONTENTS FROM boxes ORDER 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 different contents of boxes, ordered alphabetically?
SELECT DISTINCT CONTENTS FROM boxes ORDER 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 code of all boxes whose value is higher than the value of any boxes with Rocks as content.
SELECT code FROM boxes WHERE value > (SELECT min(value) FROM boxes WHERE CONTENTS = 'Rocks')
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 codes of boxes for which the value is greater than the value of any box that contains Rocks?
SELECT code FROM boxes WHERE value > (SELECT min(value) FROM boxes WHERE CONTENTS = 'Rocks')
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 code and content of all boxes whose value is higher than the value of all boxes with Scissors as content.
SELECT code , CONTENTS FROM boxes WHERE value > (SELECT max(value) FROM boxes WHERE CONTENTS = 'Scissors')
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 codes and corresponding contents of boxes for which their value is higher than the values of all boxes containing Scissors?
SELECT code , CONTENTS FROM boxes WHERE value > (SELECT max(value) FROM boxes WHERE CONTENTS = 'Scissors')
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 total value of boxes stored in the warehouse with the largest capacity.
SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code ORDER BY T2.capacity DESC LIMIT 1
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 is the total value of boxes kept in the warehouse with the greatest capacity?
SELECT sum(T1.value) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code ORDER BY T2.capacity DESC LIMIT 1
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 the warehouse code and the average value of the boxes only for those warehouses where the average value of the boxes is greater than 150.
SELECT warehouse , avg(value) FROM boxes GROUP BY warehouse HAVING avg(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 average values of boxes for each warehouse than has an average value greater than 150?
SELECT warehouse , avg(value) FROM boxes GROUP BY warehouse HAVING avg(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']}]
Find the total value and number of boxes for each content type.
SELECT sum(value) , count(*) , 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']}]
For each content, what is the total value and number of boxes?
SELECT sum(value) , count(*) , 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 total, average, and maximum capacity for different locations.
SELECT sum(capacity) , avg(capacity) , max(capacity) , LOCATION FROM warehouses GROUP BY LOCATION
warehouse_1
[{'table_name': 'warehouses', 'table_schema': [{'col_name': 'code'}, {'col_name': 'location'}, {'col_name': 'capacity'}], 'foreign_key_columns': [], 'primary_keys': ['code']}]
For each location, what are the total, average, and maximum capacities of warehouses?
SELECT sum(capacity) , avg(capacity) , max(capacity) , LOCATION FROM warehouses GROUP BY LOCATION
warehouse_1
[{'table_name': 'warehouses', 'table_schema': [{'col_name': 'code'}, {'col_name': 'location'}, {'col_name': 'capacity'}], 'foreign_key_columns': [], 'primary_keys': ['code']}]
Find the total capacity of all warehouse locations.
SELECT 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 is the total capacity of all warehouses?
SELECT 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 value of the most expensive boxes saved in each warehouse location.
SELECT max(T1.value) , T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code GROUP BY T2.location
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...
For each warehouse location, what is the value of the most expensive box?
SELECT max(T1.value) , T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code GROUP BY T2.location
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 the warehouse codes along with the number of boxes in each warehouse.
SELECT Warehouse , count(*) 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']}]
How many boxes are there with each warehouse ?
select warehouse , count(*) 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 number of different locations where Rocks are stored.
SELECT count(DISTINCT LOCATION) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Rocks'
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...
In how many different warehouses are Rocks stored within boxes?
SELECT count(DISTINCT LOCATION) FROM boxes AS T1 JOIN warehouses AS T2 ON T1.warehouse = T2.code WHERE T1.contents = 'Rocks'
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 the code of each box, along with the name of the city the box is located in.
SELECT T1.code , T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.Warehouse = T2.Code
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 the codes of all boxes, as well as the locations of the warehouses they are in?
SELECT T1.code , T2.location FROM boxes AS T1 JOIN warehouses AS T2 ON T1.Warehouse = T2.Code
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 the codes of all the boxes located in Chicago.
SELECT T1.code FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location = 'Chicago'
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 the codes of boxes stored in warehouses in Chicago?
SELECT T1.code FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location = 'Chicago'
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...
Find the number of boxes saved in each warehouse.
SELECT count(*) , warehouse 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']}]
How many boxes are stored in each warehouse?
SELECT count(*) , warehouse 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 number of distinct types of contents in each warehouse.
SELECT count(DISTINCT CONTENTS) , warehouse 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']}]
How many different types of contents are stored in each warehouse?
SELECT count(DISTINCT CONTENTS) , warehouse 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']}]
Select the codes of all warehouses that are above capacity.
SELECT T2.code FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse = T2.code GROUP BY T2.code HAVING count(*) > T2.capacity
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 the codes of warehouses that have more boxes than their capacity?
SELECT T2.code FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse = T2.code GROUP BY T2.code HAVING count(*) > T2.capacity
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...
Find the total values of boxes that are not in the warehouses located at Chicago.
SELECT sum(T1.value) FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location != 'Chicago'
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 is the total value of boxes contained in any location but Chicago?
SELECT sum(T1.value) FROM boxes AS T1 JOIN Warehouses AS T2 ON T1.warehouse = T2.code WHERE T2.location != 'Chicago'
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...
Show name, city, and state for all universities in alphabetical order of university name.
SELECT university_name , city , state FROM University ORDER BY university_name
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the names, cities, and states of all universities in alphabetical order (by name of the university).
SELECT university_name , city , state FROM University ORDER BY university_name
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
How many universities are in Illinois or Ohio?
SELECT count(*) FROM University WHERE state = 'Illinois' OR state = 'Ohio'
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the total number of universities located in Illinois or Ohio?
SELECT count(*) FROM University WHERE state = 'Illinois' OR state = 'Ohio'
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the maximum, average, and minimum enrollment for universities?
SELECT max(enrollment) , avg(enrollment) , min(enrollment) FROM University
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the maximum, average, and minimum enrollment for all universities?
SELECT max(enrollment) , avg(enrollment) , min(enrollment) FROM University
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
List team name for all universities with enrollments above the average.
SELECT team_name FROM University WHERE enrollment > (SELECT avg(enrollment) FROM University)
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the names of all teams from universities that have more people enrolled than average ?
select team_name from university where enrollment > (select avg(enrollment) from university)
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
Show all home conferences.
SELECT DISTINCT home_conference FROM University
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the different home conferences from the university table?
SELECT DISTINCT home_conference FROM University
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
Show all home conferences and the number of universities in each conference.
SELECT home_conference , count(*) FROM University GROUP BY home_conference
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
For every home conference, how many universities attended that conference?
SELECT home_conference , count(*) FROM University GROUP BY home_conference
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
Which state has most number of universities?
SELECT state FROM University GROUP BY state ORDER BY count(*) DESC LIMIT 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the state with the most universities?
SELECT state FROM University GROUP BY state ORDER BY count(*) DESC LIMIT 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
Show all home conferences with average enrollment of universities above 2000.
SELECT home_conference FROM University GROUP BY home_conference HAVING avg(enrollment) > 2000
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the home conferences that have an average university enrollment above 2000?
SELECT home_conference FROM University GROUP BY home_conference HAVING avg(enrollment) > 2000
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
Which conference has the least number of total enrollment?
SELECT home_conference FROM University GROUP BY home_conference ORDER BY sum(enrollment) LIMIT 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the home conferences with the fewest number of people enrolled?
SELECT home_conference FROM University GROUP BY home_conference ORDER BY sum(enrollment) LIMIT 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
List all major name and major code in the order of their major code
SELECT major_name , major_code FROM Major ORDER BY major_code
university_rank
[{'table_name': 'major', 'table_schema': [{'col_name': 'major id'}, {'col_name': 'major name'}, {'col_name': 'major code'}], 'foreign_key_columns': [], 'primary_keys': ['major id']}]
What are the names and codes for all majors ordered by their code?
SELECT major_name , major_code FROM Major ORDER BY major_code
university_rank
[{'table_name': 'major', 'table_schema': [{'col_name': 'major id'}, {'col_name': 'major name'}, {'col_name': 'major code'}], 'foreign_key_columns': [], 'primary_keys': ['major id']}]
Show all majors and major ranks for the university with name Augustana College.
SELECT T1.rank , T3.major_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id = T2.university_id AND T1.major_id = T3.major_id WHERE T2.university_name = 'Augustana College'
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the ranks and names of all majors at Augustana College?
SELECT T1.rank , T3.major_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id = T2.university_id AND T1.major_id = T3.major_id WHERE T2.university_name = 'Augustana College'
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the name, city, state of the university with a rank 1 on Accounting major?
SELECT T2.university_name , T2.city , T2.state FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id = T2.university_id AND T1.major_id = T3.major_id WHERE T1.rank = 1 AND T3.major_name = 'Accounting'
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the name, city, and state of the university with number 1 ranked Accounting major?
SELECT T2.university_name , T2.city , T2.state FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id = T2.university_id AND T1.major_id = T3.major_id WHERE T1.rank = 1 AND T3.major_name = 'Accounting'
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the name of the university that has most number of majors with rank 1?
SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 ON T1.university_id = T2.university_id WHERE T1.rank = 1 GROUP BY T2.university_name ORDER BY count(*) DESC LIMIT 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the name of the university with the most majors ranked number 1?
SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 ON T1.university_id = T2.university_id WHERE T1.rank = 1 GROUP BY T2.university_name ORDER BY count(*) DESC LIMIT 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
Show all university names without a major with rank 1?
SELECT university_name FROM University EXCEPT SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 ON T1.university_id = T2.university_id WHERE T1.rank = 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the names of all universities without any majors ranked number 1?
SELECT university_name FROM University EXCEPT SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 ON T1.university_id = T2.university_id WHERE T1.rank = 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
Show all university names with both major Accounting and major Urban Education.
SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id = T2.university_id AND T1.major_id = T3.major_id WHERE T3.major_name = 'Accounting' INTERSECT SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id ...
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the names of all universities that have both Accounting and Urban Education majors?
SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id = T2.university_id AND T1.major_id = T3.major_id WHERE T3.major_name = 'Accounting' INTERSECT SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id ...
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the name and overall ranking of universities in Wisconsin state?
SELECT T1.university_name , T2.rank FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id WHERE T1.state = 'Wisconsin'
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the name and rank of every university in Wisconsin?
SELECT T1.university_name , T2.rank FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id WHERE T1.state = 'Wisconsin'
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the university name with highest research point?
SELECT T1.university_name FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id ORDER BY T2.research_point DESC LIMIT 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the name of the university with the most research points?
SELECT T1.university_name FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id ORDER BY T2.research_point DESC LIMIT 1
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
List all university names in ascending order of their reputation points.
SELECT T1.university_name FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id ORDER BY T2.reputation_point
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the names of all universities in ascending order of reputation points?
SELECT T1.university_name FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id ORDER BY T2.reputation_point
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the name of university with major Accounting ranked 3 or above?
SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id = T2.university_id AND T1.major_id = T3.major_id WHERE T1.rank <= 3 AND T3.major_name = "Accounting"
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What are the names of the university with an Accounting major ranked 3 or higher?
SELECT T2.university_name FROM Major_Ranking AS T1 JOIN University AS T2 JOIN Major AS T3 ON T1.university_id = T2.university_id AND T1.major_id = T3.major_id WHERE T1.rank <= 3 AND T3.major_name = "Accounting"
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the total enrollment of universities with a overall rank 5 or below?
SELECT sum(enrollment) FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id WHERE T2.rank >= 5
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
What is the total number of students enrolled in an university with a rank of 5 or below?
SELECT sum(enrollment) FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id WHERE T2.rank >= 5
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...
Find the name and Citation point of the universities whose reputation points are top 3 and above.
SELECT T1.University_Name , T2.Citation_point FROM University AS T1 JOIN Overall_ranking AS T2 ON T1.university_id = T2.university_id ORDER BY T2.Reputation_point DESC LIMIT 3
university_rank
[{'table_name': 'university', 'table_schema': [{'col_name': 'university id'}, {'col_name': 'university name'}, {'col_name': 'city'}, {'col_name': 'state'}, {'col_name': 'team name'}, {'col_name': 'affiliation'}, {'col_name': 'enrollment'}, {'col_name': 'home conference'}], 'foreign_key_columns': [], 'primary_keys': ['u...