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