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