question
stringlengths
12
244
context
stringlengths
27
489
answer
stringlengths
18
557
text
stringlengths
114
1.06k
When is the last day any resident moved in?
CREATE TABLE Residents (date_moved_in INTEGER)
SELECT MAX(date_moved_in) FROM Residents
### Context: CREATE TABLE Residents (date_moved_in INTEGER) ### Question: When is the last day any resident moved in? ### Answer: SELECT MAX(date_moved_in) FROM Residents
What are the resident details containing the substring 'Miss'?
CREATE TABLE Residents (other_details VARCHAR)
SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%'
### Context: CREATE TABLE Residents (other_details VARCHAR) ### Question: What are the resident details containing the substring 'Miss'? ### Answer: SELECT other_details FROM Residents WHERE other_details LIKE '%Miss%'
List the customer event id and the corresponding move in date and property id.
CREATE TABLE customer_events (customer_event_id VARCHAR, date_moved_in VARCHAR, property_id VARCHAR)
SELECT customer_event_id, date_moved_in, property_id FROM customer_events
### Context: CREATE TABLE customer_events (customer_event_id VARCHAR, date_moved_in VARCHAR, property_id VARCHAR) ### Question: List the customer event id and the corresponding move in date and property id. ### Answer: SELECT customer_event_id, date_moved_in, property_id FROM customer_events
How many customers did not have any event?
CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE customer_events (customer_id VARCHAR)
SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_events)
### Context: CREATE TABLE customers (customer_id VARCHAR); CREATE TABLE customer_events (customer_id VARCHAR) ### Question: How many customers did not have any event? ### Answer: SELECT COUNT(*) FROM customers WHERE NOT customer_id IN (SELECT customer_id FROM customer_events)
What are the distinct move in dates of the residents?
CREATE TABLE residents (date_moved_in VARCHAR)
SELECT DISTINCT date_moved_in FROM residents
### Context: CREATE TABLE residents (date_moved_in VARCHAR) ### Question: What are the distinct move in dates of the residents? ### Answer: SELECT DISTINCT date_moved_in FROM residents
List the locations of schools in ascending order of enrollment.
CREATE TABLE school (LOCATION VARCHAR, Enrollment VARCHAR)
SELECT LOCATION FROM school ORDER BY Enrollment
### Context: CREATE TABLE school (LOCATION VARCHAR, Enrollment VARCHAR) ### Question: List the locations of schools in ascending order of enrollment. ### Answer: SELECT LOCATION FROM school ORDER BY Enrollment
List the locations of schools in descending order of founded year.
CREATE TABLE school (LOCATION VARCHAR, Founded VARCHAR)
SELECT LOCATION FROM school ORDER BY Founded DESC
### Context: CREATE TABLE school (LOCATION VARCHAR, Founded VARCHAR) ### Question: List the locations of schools in descending order of founded year. ### Answer: SELECT LOCATION FROM school ORDER BY Founded DESC
What are the enrollments of schools whose denomination is not "Catholic"?
CREATE TABLE school (Enrollment VARCHAR, Denomination VARCHAR)
SELECT Enrollment FROM school WHERE Denomination <> "Catholic"
### Context: CREATE TABLE school (Enrollment VARCHAR, Denomination VARCHAR) ### Question: What are the enrollments of schools whose denomination is not "Catholic"? ### Answer: SELECT Enrollment FROM school WHERE Denomination <> "Catholic"
What is the average enrollment of schools?
CREATE TABLE school (Enrollment INTEGER)
SELECT AVG(Enrollment) FROM school
### Context: CREATE TABLE school (Enrollment INTEGER) ### Question: What is the average enrollment of schools? ### Answer: SELECT AVG(Enrollment) FROM school
What are the teams of the players, sorted in ascending alphabetical order?
CREATE TABLE player (Team VARCHAR)
SELECT Team FROM player ORDER BY Team
### Context: CREATE TABLE player (Team VARCHAR) ### Question: What are the teams of the players, sorted in ascending alphabetical order? ### Answer: SELECT Team FROM player ORDER BY Team
Find the team of the player of the highest age.
CREATE TABLE player (Team VARCHAR, Age VARCHAR)
SELECT Team FROM player ORDER BY Age DESC LIMIT 1
### Context: CREATE TABLE player (Team VARCHAR, Age VARCHAR) ### Question: Find the team of the player of the highest age. ### Answer: SELECT Team FROM player ORDER BY Age DESC LIMIT 1
List the teams of the players with the top 5 largest ages.
CREATE TABLE player (Team VARCHAR, Age VARCHAR)
SELECT Team FROM player ORDER BY Age DESC LIMIT 5
### Context: CREATE TABLE player (Team VARCHAR, Age VARCHAR) ### Question: List the teams of the players with the top 5 largest ages. ### Answer: SELECT Team FROM player ORDER BY Age DESC LIMIT 5
For each player, show the team and the location of school they belong to.
CREATE TABLE school (Location VARCHAR, School_ID VARCHAR); CREATE TABLE player (Team VARCHAR, School_ID VARCHAR)
SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID
### Context: CREATE TABLE school (Location VARCHAR, School_ID VARCHAR); CREATE TABLE player (Team VARCHAR, School_ID VARCHAR) ### Question: For each player, show the team and the location of school they belong to. ### Answer: SELECT T1.Team, T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID
Show the locations of schools that have more than 1 player.
CREATE TABLE player (School_ID VARCHAR); CREATE TABLE school (Location VARCHAR, School_ID VARCHAR)
SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1
### Context: CREATE TABLE player (School_ID VARCHAR); CREATE TABLE school (Location VARCHAR, School_ID VARCHAR) ### Question: Show the locations of schools that have more than 1 player. ### Answer: SELECT T2.Location FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID HAVING COUNT(*) > 1
Show the denomination of the school that has the most players.
CREATE TABLE player (School_ID VARCHAR); CREATE TABLE school (Denomination VARCHAR, School_ID VARCHAR)
SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1
### Context: CREATE TABLE player (School_ID VARCHAR); CREATE TABLE school (Denomination VARCHAR, School_ID VARCHAR) ### Question: Show the denomination of the school that has the most players. ### Answer: SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1
Show locations and nicknames of schools.
CREATE TABLE school (Location VARCHAR, School_ID VARCHAR); CREATE TABLE school_details (Nickname VARCHAR, School_ID VARCHAR)
SELECT T1.Location, T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID
### Context: CREATE TABLE school (Location VARCHAR, School_ID VARCHAR); CREATE TABLE school_details (Nickname VARCHAR, School_ID VARCHAR) ### Question: Show locations and nicknames of schools. ### Answer: SELECT T1.Location, T2.Nickname FROM school AS T1 JOIN school_details AS T2 ON T1.School_ID = T2.School_ID
Please show different denominations and the corresponding number of schools.
CREATE TABLE school (Denomination VARCHAR)
SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination
### Context: CREATE TABLE school (Denomination VARCHAR) ### Question: Please show different denominations and the corresponding number of schools. ### Answer: SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination
Please show different denominations and the corresponding number of schools in descending order.
CREATE TABLE school (Denomination VARCHAR)
SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
### Context: CREATE TABLE school (Denomination VARCHAR) ### Question: Please show different denominations and the corresponding number of schools in descending order. ### Answer: SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY COUNT(*) DESC
List the school color of the school that has the largest enrollment.
CREATE TABLE school (School_Colors VARCHAR, Enrollment VARCHAR)
SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
### Context: CREATE TABLE school (School_Colors VARCHAR, Enrollment VARCHAR) ### Question: List the school color of the school that has the largest enrollment. ### Answer: SELECT School_Colors FROM school ORDER BY Enrollment DESC LIMIT 1
List the locations of schools that do not have any player.
CREATE TABLE school (LOCATION VARCHAR, School_ID VARCHAR); CREATE TABLE Player (LOCATION VARCHAR, School_ID VARCHAR)
SELECT LOCATION FROM school WHERE NOT School_ID IN (SELECT School_ID FROM Player)
### Context: CREATE TABLE school (LOCATION VARCHAR, School_ID VARCHAR); CREATE TABLE Player (LOCATION VARCHAR, School_ID VARCHAR) ### Question: List the locations of schools that do not have any player. ### Answer: SELECT LOCATION FROM school WHERE NOT School_ID IN (SELECT School_ID FROM Player)
Show the denomination shared by schools founded before 1890 and schools founded after 1900
CREATE TABLE school (Denomination VARCHAR, Founded INTEGER)
SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900
### Context: CREATE TABLE school (Denomination VARCHAR, Founded INTEGER) ### Question: Show the denomination shared by schools founded before 1890 and schools founded after 1900 ### Answer: SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900
Show the nicknames of schools that are not in division 1.
CREATE TABLE school_details (Nickname VARCHAR, Division VARCHAR)
SELECT Nickname FROM school_details WHERE Division <> "Division 1"
### Context: CREATE TABLE school_details (Nickname VARCHAR, Division VARCHAR) ### Question: Show the nicknames of schools that are not in division 1. ### Answer: SELECT Nickname FROM school_details WHERE Division <> "Division 1"
Show the denomination shared by more than one school.
CREATE TABLE school (Denomination VARCHAR)
SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1
### Context: CREATE TABLE school (Denomination VARCHAR) ### Question: Show the denomination shared by more than one school. ### Answer: SELECT Denomination FROM school GROUP BY Denomination HAVING COUNT(*) > 1
Find all the distinct district names ordered by city area in descending.
CREATE TABLE district (District_name VARCHAR, city_area VARCHAR)
SELECT DISTINCT District_name FROM district ORDER BY city_area DESC
### Context: CREATE TABLE district (District_name VARCHAR, city_area VARCHAR) ### Question: Find all the distinct district names ordered by city area in descending. ### Answer: SELECT DISTINCT District_name FROM district ORDER BY city_area DESC
Find the list of page size which have more than 3 product listed
CREATE TABLE product (max_page_size VARCHAR)
SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3
### Context: CREATE TABLE product (max_page_size VARCHAR) ### Question: Find the list of page size which have more than 3 product listed ### Answer: SELECT max_page_size FROM product GROUP BY max_page_size HAVING COUNT(*) > 3
Find the name and population of district with population between 200000 and 2000000
CREATE TABLE district (District_name VARCHAR, City_Population INTEGER)
SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000
### Context: CREATE TABLE district (District_name VARCHAR, City_Population INTEGER) ### Question: Find the name and population of district with population between 200000 and 2000000 ### Answer: SELECT District_name, City_Population FROM district WHERE City_Population BETWEEN 200000 AND 2000000
Find the name all districts with city area greater than 10 or population larger than 100000
CREATE TABLE district (district_name VARCHAR, city_area VARCHAR, City_Population VARCHAR)
SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000
### Context: CREATE TABLE district (district_name VARCHAR, city_area VARCHAR, City_Population VARCHAR) ### Question: Find the name all districts with city area greater than 10 or population larger than 100000 ### Answer: SELECT district_name FROM district WHERE city_area > 10 OR City_Population > 100000
Which district has the largest population?
CREATE TABLE district (district_name VARCHAR, city_population VARCHAR)
SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1
### Context: CREATE TABLE district (district_name VARCHAR, city_population VARCHAR) ### Question: Which district has the largest population? ### Answer: SELECT district_name FROM district ORDER BY city_population DESC LIMIT 1
Which district has the least area?
CREATE TABLE district (district_name VARCHAR, city_area VARCHAR)
SELECT district_name FROM district ORDER BY city_area LIMIT 1
### Context: CREATE TABLE district (district_name VARCHAR, city_area VARCHAR) ### Question: Which district has the least area? ### Answer: SELECT district_name FROM district ORDER BY city_area LIMIT 1
Find the total population of the top 3 districts with the largest area.
CREATE TABLE district (city_population INTEGER, city_area VARCHAR)
SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3
### Context: CREATE TABLE district (city_population INTEGER, city_area VARCHAR) ### Question: Find the total population of the top 3 districts with the largest area. ### Answer: SELECT SUM(city_population) FROM district ORDER BY city_area DESC LIMIT 3
Find all types of store and number of them.
CREATE TABLE store (TYPE VARCHAR)
SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE
### Context: CREATE TABLE store (TYPE VARCHAR) ### Question: Find all types of store and number of them. ### Answer: SELECT TYPE, COUNT(*) FROM store GROUP BY TYPE
Find the names of all stores in Khanewal District.
CREATE TABLE district (district_id VARCHAR, district_name VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_name VARCHAR, store_id VARCHAR)
SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = "Khanewal District"
### Context: CREATE TABLE district (district_id VARCHAR, district_name VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_name VARCHAR, store_id VARCHAR) ### Question: Find the names of all stores in Khanewal District. ### Answer: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t3.district_name = "Khanewal District"
Find all the stores in the district with the most population.
CREATE TABLE store_district (store_id VARCHAR); CREATE TABLE district (district_id VARCHAR, city_population VARCHAR); CREATE TABLE store (store_name VARCHAR, store_id VARCHAR)
SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)
### Context: CREATE TABLE store_district (store_id VARCHAR); CREATE TABLE district (district_id VARCHAR, city_population VARCHAR); CREATE TABLE store (store_name VARCHAR, store_id VARCHAR) ### Question: Find all the stores in the district with the most population. ### Answer: SELECT t1.store_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id WHERE district_id = (SELECT district_id FROM district ORDER BY city_population DESC LIMIT 1)
Which city is the headquarter of the store named "Blackville" in?
CREATE TABLE store (store_id VARCHAR, store_name VARCHAR); CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR)
SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = "Blackville"
### Context: CREATE TABLE store (store_id VARCHAR, store_name VARCHAR); CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR) ### Question: Which city is the headquarter of the store named "Blackville" in? ### Answer: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = "Blackville"
Find the number of stores in each city.
CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR)
SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city
### Context: CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR) ### Question: Find the number of stores in each city. ### Answer: SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city
Find the city with the most number of stores.
CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR)
SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1
### Context: CREATE TABLE district (headquartered_city VARCHAR, district_id VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR) ### Question: Find the city with the most number of stores. ### Answer: SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city ORDER BY COUNT(*) DESC LIMIT 1
What is the average pages per minute color?
CREATE TABLE product (pages_per_minute_color INTEGER)
SELECT AVG(pages_per_minute_color) FROM product
### Context: CREATE TABLE product (pages_per_minute_color INTEGER) ### Question: What is the average pages per minute color? ### Answer: SELECT AVG(pages_per_minute_color) FROM product
What products are available at store named "Miramichi"?
CREATE TABLE store_product (product_id VARCHAR, store_id VARCHAR); CREATE TABLE store (store_id VARCHAR, store_name VARCHAR); CREATE TABLE product (product VARCHAR, product_id VARCHAR)
SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = "Miramichi"
### Context: CREATE TABLE store_product (product_id VARCHAR, store_id VARCHAR); CREATE TABLE store (store_id VARCHAR, store_name VARCHAR); CREATE TABLE product (product VARCHAR, product_id VARCHAR) ### Question: What products are available at store named "Miramichi"? ### Answer: SELECT t1.product FROM product AS t1 JOIN store_product AS t2 ON t1.product_id = t2.product_id JOIN store AS t3 ON t2.store_id = t3.store_id WHERE t3.store_name = "Miramichi"
Find products with max page size as "A4" and pages per minute color smaller than 5.
CREATE TABLE product (product VARCHAR, max_page_size VARCHAR, pages_per_minute_color VARCHAR)
SELECT product FROM product WHERE max_page_size = "A4" AND pages_per_minute_color < 5
### Context: CREATE TABLE product (product VARCHAR, max_page_size VARCHAR, pages_per_minute_color VARCHAR) ### Question: Find products with max page size as "A4" and pages per minute color smaller than 5. ### Answer: SELECT product FROM product WHERE max_page_size = "A4" AND pages_per_minute_color < 5
Find products with max page size as "A4" or pages per minute color smaller than 5.
CREATE TABLE product (product VARCHAR, max_page_size VARCHAR, pages_per_minute_color VARCHAR)
SELECT product FROM product WHERE max_page_size = "A4" OR pages_per_minute_color < 5
### Context: CREATE TABLE product (product VARCHAR, max_page_size VARCHAR, pages_per_minute_color VARCHAR) ### Question: Find products with max page size as "A4" or pages per minute color smaller than 5. ### Answer: SELECT product FROM product WHERE max_page_size = "A4" OR pages_per_minute_color < 5
Find all the product whose name contains the word "Scanner".
CREATE TABLE product (product VARCHAR)
SELECT product FROM product WHERE product LIKE "%Scanner%"
### Context: CREATE TABLE product (product VARCHAR) ### Question: Find all the product whose name contains the word "Scanner". ### Answer: SELECT product FROM product WHERE product LIKE "%Scanner%"
Find the most prominent max page size among all the products.
CREATE TABLE product (max_page_size VARCHAR)
SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1
### Context: CREATE TABLE product (max_page_size VARCHAR) ### Question: Find the most prominent max page size among all the products. ### Answer: SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1
Find the name of the products that are not using the most frequently-used max page size.
CREATE TABLE product (product VARCHAR, max_page_size VARCHAR)
SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1)
### Context: CREATE TABLE product (product VARCHAR, max_page_size VARCHAR) ### Question: Find the name of the products that are not using the most frequently-used max page size. ### Answer: SELECT product FROM product WHERE product <> (SELECT max_page_size FROM product GROUP BY max_page_size ORDER BY COUNT(*) DESC LIMIT 1)
Find the total population of the districts where the area is bigger than the average city area.
CREATE TABLE district (city_population INTEGER, city_area INTEGER)
SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district)
### Context: CREATE TABLE district (city_population INTEGER, city_area INTEGER) ### Question: Find the total population of the districts where the area is bigger than the average city area. ### Answer: SELECT SUM(city_population) FROM district WHERE city_area > (SELECT AVG(city_area) FROM district)
Find the names of districts where have both city mall and village store type stores.
CREATE TABLE district (District_name VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR, Type VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR)
SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = "City Mall" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = "Village Store"
### Context: CREATE TABLE district (District_name VARCHAR, district_id VARCHAR); CREATE TABLE store (store_id VARCHAR, Type VARCHAR); CREATE TABLE store_district (store_id VARCHAR, district_id VARCHAR) ### Question: Find the names of districts where have both city mall and village store type stores. ### Answer: SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = "City Mall" INTERSECT SELECT t3.District_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.Type = "Village Store"
What is the total enrollment number of all colleges?
CREATE TABLE College (enr INTEGER)
SELECT SUM(enr) FROM College
### Context: CREATE TABLE College (enr INTEGER) ### Question: What is the total enrollment number of all colleges? ### Answer: SELECT SUM(enr) FROM College
What is the average enrollment number?
CREATE TABLE College (enr INTEGER)
SELECT AVG(enr) FROM College
### Context: CREATE TABLE College (enr INTEGER) ### Question: What is the average enrollment number? ### Answer: SELECT AVG(enr) FROM College
How many colleges in total?
CREATE TABLE College (Id VARCHAR)
SELECT COUNT(*) FROM College
### Context: CREATE TABLE College (Id VARCHAR) ### Question: How many colleges in total? ### Answer: SELECT COUNT(*) FROM College
How many players have more than 1000 hours of training?
CREATE TABLE Player (HS INTEGER)
SELECT COUNT(*) FROM Player WHERE HS > 1000
### Context: CREATE TABLE Player (HS INTEGER) ### Question: How many players have more than 1000 hours of training? ### Answer: SELECT COUNT(*) FROM Player WHERE HS > 1000
How many colleges has more than 15000 students?
CREATE TABLE College (enr INTEGER)
SELECT COUNT(*) FROM College WHERE enr > 15000
### Context: CREATE TABLE College (enr INTEGER) ### Question: How many colleges has more than 15000 students? ### Answer: SELECT COUNT(*) FROM College WHERE enr > 15000
What is the average training hours of all players?
CREATE TABLE Player (HS INTEGER)
SELECT AVG(HS) FROM Player
### Context: CREATE TABLE Player (HS INTEGER) ### Question: What is the average training hours of all players? ### Answer: SELECT AVG(HS) FROM Player
Find the name and training hours of players whose hours are below 1500.
CREATE TABLE Player (pName VARCHAR, HS INTEGER)
SELECT pName, HS FROM Player WHERE HS < 1500
### Context: CREATE TABLE Player (pName VARCHAR, HS INTEGER) ### Question: Find the name and training hours of players whose hours are below 1500. ### Answer: SELECT pName, HS FROM Player WHERE HS < 1500
How many different colleges do attend the tryout test?
CREATE TABLE tryout (cName VARCHAR)
SELECT COUNT(DISTINCT cName) FROM tryout
### Context: CREATE TABLE tryout (cName VARCHAR) ### Question: How many different colleges do attend the tryout test? ### Answer: SELECT COUNT(DISTINCT cName) FROM tryout
What are the unique types of player positions in the tryout?
CREATE TABLE tryout (pPos VARCHAR)
SELECT COUNT(DISTINCT pPos) FROM tryout
### Context: CREATE TABLE tryout (pPos VARCHAR) ### Question: What are the unique types of player positions in the tryout? ### Answer: SELECT COUNT(DISTINCT pPos) FROM tryout
How many students got accepted after the tryout?
CREATE TABLE tryout (decision VARCHAR)
SELECT COUNT(*) FROM tryout WHERE decision = 'yes'
### Context: CREATE TABLE tryout (decision VARCHAR) ### Question: How many students got accepted after the tryout? ### Answer: SELECT COUNT(*) FROM tryout WHERE decision = 'yes'
How many students whose are playing the role of goalie?
CREATE TABLE tryout (pPos VARCHAR)
SELECT COUNT(*) FROM tryout WHERE pPos = 'goalie'
### Context: CREATE TABLE tryout (pPos VARCHAR) ### Question: How many students whose are playing the role of goalie? ### Answer: SELECT COUNT(*) FROM tryout WHERE pPos = 'goalie'
Find the max, average and min training hours of all players.
CREATE TABLE Player (HS INTEGER)
SELECT AVG(HS), MAX(HS), MIN(HS) FROM Player
### Context: CREATE TABLE Player (HS INTEGER) ### Question: Find the max, average and min training hours of all players. ### Answer: SELECT AVG(HS), MAX(HS), MIN(HS) FROM Player
What is average enrollment of colleges in the state FL?
CREATE TABLE College (enr INTEGER, state VARCHAR)
SELECT AVG(enr) FROM College WHERE state = 'FL'
### Context: CREATE TABLE College (enr INTEGER, state VARCHAR) ### Question: What is average enrollment of colleges in the state FL? ### Answer: SELECT AVG(enr) FROM College WHERE state = 'FL'
What are the names of players whose training hours is between 500 and 1500?
CREATE TABLE Player (pName VARCHAR, HS INTEGER)
SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500
### Context: CREATE TABLE Player (pName VARCHAR, HS INTEGER) ### Question: What are the names of players whose training hours is between 500 and 1500? ### Answer: SELECT pName FROM Player WHERE HS BETWEEN 500 AND 1500
Find the players whose names contain letter 'a'.
CREATE TABLE Player (pName VARCHAR)
SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'
### Context: CREATE TABLE Player (pName VARCHAR) ### Question: Find the players whose names contain letter 'a'. ### Answer: SELECT DISTINCT pName FROM Player WHERE pName LIKE '%a%'
Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA.
CREATE TABLE College (cName VARCHAR, enr VARCHAR, state VARCHAR)
SELECT cName, enr FROM College WHERE enr > 10000 AND state = "LA"
### Context: CREATE TABLE College (cName VARCHAR, enr VARCHAR, state VARCHAR) ### Question: Find the name, enrollment of the colleges whose size is bigger than 10000 and location is in state LA. ### Answer: SELECT cName, enr FROM College WHERE enr > 10000 AND state = "LA"
List all information about college sorted by enrollment number in the ascending order.
CREATE TABLE College (enr VARCHAR)
SELECT * FROM College ORDER BY enr
### Context: CREATE TABLE College (enr VARCHAR) ### Question: List all information about college sorted by enrollment number in the ascending order. ### Answer: SELECT * FROM College ORDER BY enr
List the name of the colleges whose enrollment is greater 18000 sorted by the college's name.
CREATE TABLE College (cName VARCHAR, enr INTEGER)
SELECT cName FROM College WHERE enr > 18000 ORDER BY cName
### Context: CREATE TABLE College (cName VARCHAR, enr INTEGER) ### Question: List the name of the colleges whose enrollment is greater 18000 sorted by the college's name. ### Answer: SELECT cName FROM College WHERE enr > 18000 ORDER BY cName
Find the name of players whose card is yes in the descending order of training hours.
CREATE TABLE Player (pName VARCHAR, yCard VARCHAR, HS VARCHAR)
SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC
### Context: CREATE TABLE Player (pName VARCHAR, yCard VARCHAR, HS VARCHAR) ### Question: Find the name of players whose card is yes in the descending order of training hours. ### Answer: SELECT pName FROM Player WHERE yCard = 'yes' ORDER BY HS DESC
Find the name of different colleges involved in the tryout in alphabetical order.
CREATE TABLE tryout (cName VARCHAR)
SELECT DISTINCT cName FROM tryout ORDER BY cName
### Context: CREATE TABLE tryout (cName VARCHAR) ### Question: Find the name of different colleges involved in the tryout in alphabetical order. ### Answer: SELECT DISTINCT cName FROM tryout ORDER BY cName
Which position is most popular among players in the tryout?
CREATE TABLE tryout (pPos VARCHAR)
SELECT pPos FROM tryout GROUP BY pPos ORDER BY COUNT(*) DESC LIMIT 1
### Context: CREATE TABLE tryout (pPos VARCHAR) ### Question: Which position is most popular among players in the tryout? ### Answer: SELECT pPos FROM tryout GROUP BY pPos ORDER BY COUNT(*) DESC LIMIT 1
Find the number of students who participate in the tryout for each college ordered by descending count.
CREATE TABLE tryout (cName VARCHAR)
SELECT COUNT(*), cName FROM tryout GROUP BY cName ORDER BY COUNT(*) DESC
### Context: CREATE TABLE tryout (cName VARCHAR) ### Question: Find the number of students who participate in the tryout for each college ordered by descending count. ### Answer: SELECT COUNT(*), cName FROM tryout GROUP BY cName ORDER BY COUNT(*) DESC
What is minimum hours of the students playing in different position?
CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pPos VARCHAR, pID VARCHAR)
SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos
### Context: CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pPos VARCHAR, pID VARCHAR) ### Question: What is minimum hours of the students playing in different position? ### Answer: SELECT MIN(T2.HS), T1.pPos FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID GROUP BY T1.pPos
What are the names of schools with the top 3 largest size?
CREATE TABLE college (cName VARCHAR, enr VARCHAR)
SELECT cName FROM college ORDER BY enr DESC LIMIT 3
### Context: CREATE TABLE college (cName VARCHAR, enr VARCHAR) ### Question: What are the names of schools with the top 3 largest size? ### Answer: SELECT cName FROM college ORDER BY enr DESC LIMIT 3
What is the name of school that has the smallest enrollment in each state?
CREATE TABLE college (cName VARCHAR, state VARCHAR, enr INTEGER)
SELECT cName, state, MIN(enr) FROM college GROUP BY state
### Context: CREATE TABLE college (cName VARCHAR, state VARCHAR, enr INTEGER) ### Question: What is the name of school that has the smallest enrollment in each state? ### Answer: SELECT cName, state, MIN(enr) FROM college GROUP BY state
Find the states where have some college students in tryout.
CREATE TABLE college (cName VARCHAR); CREATE TABLE tryout (cName VARCHAR)
SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName
### Context: CREATE TABLE college (cName VARCHAR); CREATE TABLE tryout (cName VARCHAR) ### Question: Find the states where have some college students in tryout. ### Answer: SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName
Find the states where have some college students in tryout and their decisions are yes.
CREATE TABLE tryout (cName VARCHAR, decision VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)
SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
### Context: CREATE TABLE tryout (cName VARCHAR, decision VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### Question: Find the states where have some college students in tryout and their decisions are yes. ### Answer: SELECT DISTINCT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
Find the name and college of students whose decisions are yes in the tryout.
CREATE TABLE tryout (cName VARCHAR, pID VARCHAR, decision VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR)
SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
### Context: CREATE TABLE tryout (cName VARCHAR, pID VARCHAR, decision VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR) ### Question: Find the name and college of students whose decisions are yes in the tryout. ### Answer: SELECT T1.pName, T2.cName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
Find the name of all students who were in the tryout sorted in alphabetic order.
CREATE TABLE tryout (pID VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR)
SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName
### Context: CREATE TABLE tryout (pID VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR) ### Question: Find the name of all students who were in the tryout sorted in alphabetic order. ### Answer: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID ORDER BY T1.pName
Find the name and hours of the students whose tryout decision is yes.
CREATE TABLE player (pName VARCHAR, HS VARCHAR, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR)
SELECT T1.pName, T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
### Context: CREATE TABLE player (pName VARCHAR, HS VARCHAR, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR) ### Question: Find the name and hours of the students whose tryout decision is yes. ### Answer: SELECT T1.pName, T1.HS FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
Find the states of the colleges that have students in the tryout who played in striker position.
CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)
SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'
### Context: CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### Question: Find the states of the colleges that have students in the tryout who played in striker position. ### Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'striker'
Find the names of the students who are in the position of striker and got a yes tryout decision.
CREATE TABLE tryout (pID VARCHAR, decision VARCHAR, pPos VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR)
SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'
### Context: CREATE TABLE tryout (pID VARCHAR, decision VARCHAR, pPos VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR) ### Question: Find the names of the students who are in the position of striker and got a yes tryout decision. ### Answer: SELECT T1.pName FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes' AND T2.pPos = 'striker'
Find the state of the college which player Charles is attending.
CREATE TABLE tryout (cName VARCHAR, pID VARCHAR); CREATE TABLE player (pID VARCHAR, pName VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)
SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'
### Context: CREATE TABLE tryout (cName VARCHAR, pID VARCHAR); CREATE TABLE player (pID VARCHAR, pName VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### Question: Find the state of the college which player Charles is attending. ### Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName JOIN player AS T3 ON T2.pID = T3.pID WHERE T3.pName = 'Charles'
Find the average and maximum hours for the students whose tryout decision is yes.
CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR)
SELECT AVG(T1.HS), MAX(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
### Context: CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR) ### Question: Find the average and maximum hours for the students whose tryout decision is yes. ### Answer: SELECT AVG(T1.HS), MAX(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'yes'
Find the average hours for the students whose tryout decision is no.
CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR)
SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'
### Context: CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pID VARCHAR, decision VARCHAR) ### Question: Find the average hours for the students whose tryout decision is no. ### Answer: SELECT AVG(T1.HS) FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T2.decision = 'no'
What is the maximum training hours for the students whose training hours is greater than 1000 in different positions?
CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pPos VARCHAR, pID VARCHAR)
SELECT MAX(T1.HS), pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos
### Context: CREATE TABLE player (HS INTEGER, pID VARCHAR); CREATE TABLE tryout (pPos VARCHAR, pID VARCHAR) ### Question: What is the maximum training hours for the students whose training hours is greater than 1000 in different positions? ### Answer: SELECT MAX(T1.HS), pPos FROM player AS T1 JOIN tryout AS T2 ON T1.pID = T2.pID WHERE T1.HS > 1000 GROUP BY T2.pPos
Which colleges do the tryout players whose name starts with letter D go to?
CREATE TABLE tryout (cName VARCHAR, pID VARCHAR); CREATE TABLE player (pID VARCHAR, pName VARCHAR)
SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'
### Context: CREATE TABLE tryout (cName VARCHAR, pID VARCHAR); CREATE TABLE player (pID VARCHAR, pName VARCHAR) ### Question: Which colleges do the tryout players whose name starts with letter D go to? ### Answer: SELECT T1.cName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T2.pName LIKE 'D%'
Which college has any student who is a goalie and succeeded in the tryout.
CREATE TABLE tryout (cName VARCHAR, decision VARCHAR, pPos VARCHAR)
SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'
### Context: CREATE TABLE tryout (cName VARCHAR, decision VARCHAR, pPos VARCHAR) ### Question: Which college has any student who is a goalie and succeeded in the tryout. ### Answer: SELECT cName FROM tryout WHERE decision = 'yes' AND pPos = 'goalie'
Find the name of the tryout players who are from the college with largest size.
CREATE TABLE college (cName VARCHAR, enr VARCHAR); CREATE TABLE tryout (pID VARCHAR, cName VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR)
SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)
### Context: CREATE TABLE college (cName VARCHAR, enr VARCHAR); CREATE TABLE tryout (pID VARCHAR, cName VARCHAR); CREATE TABLE player (pName VARCHAR, pID VARCHAR) ### Question: Find the name of the tryout players who are from the college with largest size. ### Answer: SELECT T2.pName FROM tryout AS T1 JOIN player AS T2 ON T1.pID = T2.pID WHERE T1.cName = (SELECT cName FROM college ORDER BY enr DESC LIMIT 1)
What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision.
CREATE TABLE tryout (cName VARCHAR, decision VARCHAR); CREATE TABLE college (state VARCHAR, enr VARCHAR, cName VARCHAR)
SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
### Context: CREATE TABLE tryout (cName VARCHAR, decision VARCHAR); CREATE TABLE college (state VARCHAR, enr VARCHAR, cName VARCHAR) ### Question: What is the state and enrollment of the colleges where have any students who got accepted in the tryout decision. ### Answer: SELECT DISTINCT T1.state, T1.enr FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.decision = 'yes'
Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment.
CREATE TABLE College (cName VARCHAR, enr VARCHAR, state VARCHAR)
SELECT cName FROM College WHERE enr < 13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr > 15000 AND state = "LA"
### Context: CREATE TABLE College (cName VARCHAR, enr VARCHAR, state VARCHAR) ### Question: Find the names of either colleges in LA with greater than 15000 size or in state AZ with less than 13000 enrollment. ### Answer: SELECT cName FROM College WHERE enr < 13000 AND state = "AZ" UNION SELECT cName FROM College WHERE enr > 15000 AND state = "LA"
Find the names of schools that have some students playing in goalie and mid positions.
CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR)
SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'
### Context: CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR) ### Question: Find the names of schools that have some students playing in goalie and mid positions. ### Answer: SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid'
Find the names of states that have some college students playing in goalie and mid positions.
CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)
SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'
### Context: CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### Question: Find the names of states that have some college students playing in goalie and mid positions. ### Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie' INTERSECT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid'
How many schools have some students playing in goalie and mid positions.
CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR)
SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')
### Context: CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR) ### Question: How many schools have some students playing in goalie and mid positions. ### Answer: SELECT COUNT(*) FROM (SELECT cName FROM tryout WHERE pPos = 'goalie' INTERSECT SELECT cName FROM tryout WHERE pPos = 'mid')
Find the names of schools that have some players in the mid position but not in the goalie position.
CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR)
SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'
### Context: CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR) ### Question: Find the names of schools that have some players in the mid position but not in the goalie position. ### Answer: SELECT cName FROM tryout WHERE pPos = 'mid' EXCEPT SELECT cName FROM tryout WHERE pPos = 'goalie'
Find the names of states that have some college students playing in the mid position but not in the goalie position.
CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)
SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'
### Context: CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### Question: Find the names of states that have some college students playing in the mid position but not in the goalie position. ### Answer: SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie'
How many states that have some college students playing in the mid position but not in the goalie position.
CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR)
SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')
### Context: CREATE TABLE tryout (cName VARCHAR, pPos VARCHAR); CREATE TABLE college (state VARCHAR, cName VARCHAR) ### Question: How many states that have some college students playing in the mid position but not in the goalie position. ### Answer: SELECT COUNT(*) FROM (SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'mid' EXCEPT SELECT T1.state FROM college AS T1 JOIN tryout AS T2 ON T1.cName = T2.cName WHERE T2.pPos = 'goalie')
Find the states where have the colleges whose enrollments are less than the largest size.
CREATE TABLE college (state VARCHAR, enr INTEGER)
SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college)
### Context: CREATE TABLE college (state VARCHAR, enr INTEGER) ### Question: Find the states where have the colleges whose enrollments are less than the largest size. ### Answer: SELECT DISTINCT state FROM college WHERE enr < (SELECT MAX(enr) FROM college)
Find names of colleges with enrollment greater than that of some (at least one) college in the FL state.
CREATE TABLE college (cName VARCHAR, enr INTEGER, state VARCHAR)
SELECT DISTINCT cName FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL')
### Context: CREATE TABLE college (cName VARCHAR, enr INTEGER, state VARCHAR) ### Question: Find names of colleges with enrollment greater than that of some (at least one) college in the FL state. ### Answer: SELECT DISTINCT cName FROM college WHERE enr > (SELECT MIN(enr) FROM college WHERE state = 'FL')
Find names of all colleges whose enrollment is greater than that of all colleges in the FL state.
CREATE TABLE college (cName VARCHAR, enr INTEGER, state VARCHAR)
SELECT cName FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL')
### Context: CREATE TABLE college (cName VARCHAR, enr INTEGER, state VARCHAR) ### Question: Find names of all colleges whose enrollment is greater than that of all colleges in the FL state. ### Answer: SELECT cName FROM college WHERE enr > (SELECT MAX(enr) FROM college WHERE state = 'FL')
What is the total number of enrollment of schools that do not have any goalie player?
CREATE TABLE college (enr INTEGER, cName VARCHAR, pPos VARCHAR); CREATE TABLE tryout (enr INTEGER, cName VARCHAR, pPos VARCHAR)
SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = "goalie")
### Context: CREATE TABLE college (enr INTEGER, cName VARCHAR, pPos VARCHAR); CREATE TABLE tryout (enr INTEGER, cName VARCHAR, pPos VARCHAR) ### Question: What is the total number of enrollment of schools that do not have any goalie player? ### Answer: SELECT SUM(enr) FROM college WHERE NOT cName IN (SELECT cName FROM tryout WHERE pPos = "goalie")
What is the number of states that has some college whose enrollment is larger than the average enrollment?
CREATE TABLE college (state VARCHAR, enr INTEGER)
SELECT COUNT(DISTINCT state) FROM college WHERE enr > (SELECT AVG(enr) FROM college)
### Context: CREATE TABLE college (state VARCHAR, enr INTEGER) ### Question: What is the number of states that has some college whose enrollment is larger than the average enrollment? ### Answer: SELECT COUNT(DISTINCT state) FROM college WHERE enr > (SELECT AVG(enr) FROM college)
What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?
CREATE TABLE college (state VARCHAR, enr INTEGER)
SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)
### Context: CREATE TABLE college (state VARCHAR, enr INTEGER) ### Question: What is the number of states that has some colleges whose enrollment is smaller than the average enrollment? ### Answer: SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)
How many devices are there?
CREATE TABLE device (Id VARCHAR)
SELECT COUNT(*) FROM device
### Context: CREATE TABLE device (Id VARCHAR) ### Question: How many devices are there? ### Answer: SELECT COUNT(*) FROM device
List the carriers of devices in ascending alphabetical order.
CREATE TABLE device (Carrier VARCHAR)
SELECT Carrier FROM device ORDER BY Carrier
### Context: CREATE TABLE device (Carrier VARCHAR) ### Question: List the carriers of devices in ascending alphabetical order. ### Answer: SELECT Carrier FROM device ORDER BY Carrier