question
stringlengths 12
244
| context
stringlengths 27
489
| answer
stringlengths 18
557
| text
stringlengths 114
1.06k
|
---|---|---|---|
What are the maximum and minimum age of students with major 600?
|
CREATE TABLE STUDENT (Age INTEGER, Major VARCHAR)
|
SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600
|
### Context: CREATE TABLE STUDENT (Age INTEGER, Major VARCHAR) ### Question: What are the maximum and minimum age of students with major 600? ### Answer: SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600
|
Who are the advisors for students that live in a city with city code "BAL"?
|
CREATE TABLE STUDENT (Advisor VARCHAR, city_code VARCHAR)
|
SELECT Advisor FROM STUDENT WHERE city_code = "BAL"
|
### Context: CREATE TABLE STUDENT (Advisor VARCHAR, city_code VARCHAR) ### Question: Who are the advisors for students that live in a city with city code "BAL"? ### Answer: SELECT Advisor FROM STUDENT WHERE city_code = "BAL"
|
What are the distinct secretary votes in the fall election cycle?
|
CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, ELECTION_CYCLE VARCHAR)
|
SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = "Fall"
|
### Context: CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, ELECTION_CYCLE VARCHAR) ### Question: What are the distinct secretary votes in the fall election cycle? ### Answer: SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = "Fall"
|
What are the distinct president votes on 08/30/2015?
|
CREATE TABLE VOTING_RECORD (PRESIDENT_Vote VARCHAR, Registration_Date VARCHAR)
|
SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = "08/30/2015"
|
### Context: CREATE TABLE VOTING_RECORD (PRESIDENT_Vote VARCHAR, Registration_Date VARCHAR) ### Question: What are the distinct president votes on 08/30/2015? ### Answer: SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = "08/30/2015"
|
Report the distinct registration date and the election cycle.
|
CREATE TABLE VOTING_RECORD (Registration_Date VARCHAR, Election_Cycle VARCHAR)
|
SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD
|
### Context: CREATE TABLE VOTING_RECORD (Registration_Date VARCHAR, Election_Cycle VARCHAR) ### Question: Report the distinct registration date and the election cycle. ### Answer: SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD
|
Report the distinct president vote and the vice president vote.
|
CREATE TABLE VOTING_RECORD (President_Vote VARCHAR, VICE_President_Vote VARCHAR)
|
SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD
|
### Context: CREATE TABLE VOTING_RECORD (President_Vote VARCHAR, VICE_President_Vote VARCHAR) ### Question: Report the distinct president vote and the vice president vote. ### Answer: SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD
|
Find the distinct last names of the students who have class president votes.
|
CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_President_VOTE VARCHAR)
|
SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE
|
### Context: CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_President_VOTE VARCHAR) ### Question: Find the distinct last names of the students who have class president votes. ### Answer: SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE
|
Find the distinct first names of the students who have class senator votes.
|
CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_Senator_VOTE VARCHAR)
|
SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE
|
### Context: CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_Senator_VOTE VARCHAR) ### Question: Find the distinct first names of the students who have class senator votes. ### Answer: SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE
|
Find the distinct ages of students who have secretary votes in the fall election cycle.
|
CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, Election_Cycle VARCHAR); CREATE TABLE STUDENT (Age VARCHAR, StuID VARCHAR)
|
SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = "Fall"
|
### Context: CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, Election_Cycle VARCHAR); CREATE TABLE STUDENT (Age VARCHAR, StuID VARCHAR) ### Question: Find the distinct ages of students who have secretary votes in the fall election cycle. ### Answer: SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = "Fall"
|
Find the distinct Advisor of students who have treasurer votes in the spring election cycle.
|
CREATE TABLE STUDENT (Advisor VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR, Election_Cycle VARCHAR)
|
SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = "Spring"
|
### Context: CREATE TABLE STUDENT (Advisor VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR, Election_Cycle VARCHAR) ### Question: Find the distinct Advisor of students who have treasurer votes in the spring election cycle. ### Answer: SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = "Spring"
|
Find the distinct majors of students who have treasurer votes.
|
CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR); CREATE TABLE STUDENT (Major VARCHAR, StuID VARCHAR)
|
SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote
|
### Context: CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR); CREATE TABLE STUDENT (Major VARCHAR, StuID VARCHAR) ### Question: Find the distinct majors of students who have treasurer votes. ### Answer: SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote
|
Find the first and last names of all the female (sex is F) students who have president votes.
|
CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, sex VARCHAR); CREATE TABLE VOTING_RECORD (President_VOTE VARCHAR)
|
SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = "F"
|
### Context: CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, sex VARCHAR); CREATE TABLE VOTING_RECORD (President_VOTE VARCHAR) ### Question: Find the first and last names of all the female (sex is F) students who have president votes. ### Answer: SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.President_VOTE WHERE T1.sex = "F"
|
Find the first and last name of all the students of age 18 who have vice president votes.
|
CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, age VARCHAR); CREATE TABLE VOTING_RECORD (VICE_President_VOTE VARCHAR)
|
SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18
|
### Context: CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, age VARCHAR); CREATE TABLE VOTING_RECORD (VICE_President_VOTE VARCHAR) ### Question: Find the first and last name of all the students of age 18 who have vice president votes. ### Answer: SELECT DISTINCT T1.Fname, T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_President_VOTE WHERE T1.age = 18
|
How many male (sex is M) students have class senator votes in the fall election cycle?
|
CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR); CREATE TABLE STUDENT (StuID VARCHAR, Sex VARCHAR)
|
SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = "M" AND T2.Election_Cycle = "Fall"
|
### Context: CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR); CREATE TABLE STUDENT (StuID VARCHAR, Sex VARCHAR) ### Question: How many male (sex is M) students have class senator votes in the fall election cycle? ### Answer: SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.Sex = "M" AND T2.Election_Cycle = "Fall"
|
Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.
|
CREATE TABLE STUDENT (StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)
|
SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = "NYC" AND T2.Election_Cycle = "Spring"
|
### Context: CREATE TABLE STUDENT (StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) ### Question: Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle. ### Answer: SELECT COUNT(*) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = Class_Senator_Vote WHERE T1.city_code = "NYC" AND T2.Election_Cycle = "Spring"
|
Find the average age of students who live in the city with code "NYC" and have secretary votes in the spring election cycle.
|
CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)
|
SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = "NYC" AND T2.Election_Cycle = "Spring"
|
### Context: CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) ### Question: Find the average age of students who live in the city with code "NYC" and have secretary votes in the spring election cycle. ### Answer: SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.city_code = "NYC" AND T2.Election_Cycle = "Spring"
|
Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.
|
CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, Sex VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)
|
SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = "F" AND T2.Election_Cycle = "Spring"
|
### Context: CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, Sex VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) ### Question: Find the average age of female (sex is F) students who have secretary votes in the spring election cycle. ### Answer: SELECT AVG(T1.Age) FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = SECRETARY_Vote WHERE T1.Sex = "F" AND T2.Election_Cycle = "Spring"
|
Find the distinct first names of all the students who have vice president votes and whose city code is not PIT.
|
CREATE TABLE STUDENT (Fname VARCHAR, city_code VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (VICE_PRESIDENT_Vote VARCHAR)
|
SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = "PIT"
|
### Context: CREATE TABLE STUDENT (Fname VARCHAR, city_code VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (VICE_PRESIDENT_Vote VARCHAR) ### Question: Find the distinct first names of all the students who have vice president votes and whose city code is not PIT. ### Answer: SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = "PIT"
|
Find the distinct last names of all the students who have president votes and whose advisor is not 2192.
|
CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR)
|
SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = "2192"
|
### Context: CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR) ### Question: Find the distinct last names of all the students who have president votes and whose advisor is not 2192. ### Answer: SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote EXCEPT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = "2192"
|
Find the distinct last names of all the students who have president votes and whose advisor is 8741.
|
CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR)
|
SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = "8741"
|
### Context: CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR) ### Question: Find the distinct last names of all the students who have president votes and whose advisor is 8741. ### Answer: SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = PRESIDENT_Vote INTERSECT SELECT DISTINCT LName FROM STUDENT WHERE Advisor = "8741"
|
For each advisor, report the total number of students advised by him or her.
|
CREATE TABLE STUDENT (Advisor VARCHAR)
|
SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor
|
### Context: CREATE TABLE STUDENT (Advisor VARCHAR) ### Question: For each advisor, report the total number of students advised by him or her. ### Answer: SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor
|
Report all advisors that advise more than 2 students.
|
CREATE TABLE STUDENT (Advisor VARCHAR)
|
SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
|
### Context: CREATE TABLE STUDENT (Advisor VARCHAR) ### Question: Report all advisors that advise more than 2 students. ### Answer: SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
|
Report all majors that have less than 3 students.
|
CREATE TABLE STUDENT (Major VARCHAR)
|
SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
|
### Context: CREATE TABLE STUDENT (Major VARCHAR) ### Question: Report all majors that have less than 3 students. ### Answer: SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
|
For each election cycle, report the number of voting records.
|
CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)
|
SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle
|
### Context: CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) ### Question: For each election cycle, report the number of voting records. ### Answer: SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle
|
Which major has the most students?
|
CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR)
|
SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR) ### Question: Which major has the most students? ### Answer: SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
|
What is the most common major among female (sex is F) students?
|
CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR, Sex VARCHAR)
|
SELECT Major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR, Sex VARCHAR) ### Question: What is the most common major among female (sex is F) students? ### Answer: SELECT Major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
|
What is the city_code of the city that the most students live in?
|
CREATE TABLE STUDENT (city_code VARCHAR)
|
SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE STUDENT (city_code VARCHAR) ### Question: What is the city_code of the city that the most students live in? ### Answer: SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1
|
How many products are there?
|
CREATE TABLE products (Id VARCHAR)
|
SELECT COUNT(*) FROM products
|
### Context: CREATE TABLE products (Id VARCHAR) ### Question: How many products are there? ### Answer: SELECT COUNT(*) FROM products
|
How many colors are there?
|
CREATE TABLE ref_colors (Id VARCHAR)
|
SELECT COUNT(*) FROM ref_colors
|
### Context: CREATE TABLE ref_colors (Id VARCHAR) ### Question: How many colors are there? ### Answer: SELECT COUNT(*) FROM ref_colors
|
How many characteristics are there?
|
CREATE TABLE CHARACTERISTICS (Id VARCHAR)
|
SELECT COUNT(*) FROM CHARACTERISTICS
|
### Context: CREATE TABLE CHARACTERISTICS (Id VARCHAR) ### Question: How many characteristics are there? ### Answer: SELECT COUNT(*) FROM CHARACTERISTICS
|
What are the names and buying prices of all the products?
|
CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR)
|
SELECT product_name, typical_buying_price FROM products
|
### Context: CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR) ### Question: What are the names and buying prices of all the products? ### Answer: SELECT product_name, typical_buying_price FROM products
|
List the description of all the colors.
|
CREATE TABLE ref_colors (color_description VARCHAR)
|
SELECT color_description FROM ref_colors
|
### Context: CREATE TABLE ref_colors (color_description VARCHAR) ### Question: List the description of all the colors. ### Answer: SELECT color_description FROM ref_colors
|
Find the names of all the product characteristics.
|
CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR)
|
SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR) ### Question: Find the names of all the product characteristics. ### Answer: SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
|
What are the names of products with category "Spices"?
|
CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR)
|
SELECT product_name FROM products WHERE product_category_code = "Spices"
|
### Context: CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR) ### Question: What are the names of products with category "Spices"? ### Answer: SELECT product_name FROM products WHERE product_category_code = "Spices"
|
List the names, color descriptions and product descriptions of products with category "Herbs".
|
CREATE TABLE Ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_name VARCHAR, product_description VARCHAR, color_code VARCHAR)
|
SELECT T1.product_name, T2.color_description, T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = "Herbs"
|
### Context: CREATE TABLE Ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_name VARCHAR, product_description VARCHAR, color_code VARCHAR) ### Question: List the names, color descriptions and product descriptions of products with category "Herbs". ### Answer: SELECT T1.product_name, T2.color_description, T1.product_description FROM products AS T1 JOIN Ref_colors AS T2 ON T1.color_code = T2.color_code WHERE product_category_code = "Herbs"
|
How many products are there under the category "Seeds"?
|
CREATE TABLE products (product_category_code VARCHAR)
|
SELECT COUNT(*) FROM products WHERE product_category_code = "Seeds"
|
### Context: CREATE TABLE products (product_category_code VARCHAR) ### Question: How many products are there under the category "Seeds"? ### Answer: SELECT COUNT(*) FROM products WHERE product_category_code = "Seeds"
|
Find the number of products with category "Spices" and typically sold above 1000.
|
CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR)
|
SELECT COUNT(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000
|
### Context: CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR) ### Question: Find the number of products with category "Spices" and typically sold above 1000. ### Answer: SELECT COUNT(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000
|
What is the category and typical buying price of the product with name "cumin"?
|
CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR, product_name VARCHAR)
|
SELECT product_category_code, typical_buying_price FROM products WHERE product_name = "cumin"
|
### Context: CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR, product_name VARCHAR) ### Question: What is the category and typical buying price of the product with name "cumin"? ### Answer: SELECT product_category_code, typical_buying_price FROM products WHERE product_name = "cumin"
|
Which category does the product named "flax" belong to?
|
CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)
|
SELECT product_category_code FROM products WHERE product_name = "flax"
|
### Context: CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR) ### Question: Which category does the product named "flax" belong to? ### Answer: SELECT product_category_code FROM products WHERE product_name = "flax"
|
What is the name of the product with the color description 'yellow'?
|
CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR)
|
SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow'
|
### Context: CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR) ### Question: What is the name of the product with the color description 'yellow'? ### Answer: SELECT T1.product_name FROM products AS T1 JOIN ref_colors AS T2 ON T1.color_code = T2.color_code WHERE T2.color_description = 'yellow'
|
Find the category descriptions of the products whose descriptions include letter 't'.
|
CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_description VARCHAR)
|
SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'
|
### Context: CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_description VARCHAR) ### Question: Find the category descriptions of the products whose descriptions include letter 't'. ### Answer: SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'
|
What is the color description of the product with name "catnip"?
|
CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR)
|
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "catnip"
|
### Context: CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR) ### Question: What is the color description of the product with name "catnip"? ### Answer: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "catnip"
|
What is the color code and description of the product named "chervil"?
|
CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR)
|
SELECT t1.color_code, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "chervil"
|
### Context: CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR) ### Question: What is the color code and description of the product named "chervil"? ### Answer: SELECT t1.color_code, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t1.product_name = "chervil"
|
Find the id and color description of the products with at least 2 characteristics.
|
CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR)
|
SELECT t1.product_id, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING COUNT(*) >= 2
|
### Context: CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR) ### Question: Find the id and color description of the products with at least 2 characteristics. ### Answer: SELECT t1.product_id, t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code JOIN product_characteristics AS t3 ON t1.product_id = t3.product_id GROUP BY t1.product_id HAVING COUNT(*) >= 2
|
List all the product names with the color description "white".
|
CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR)
|
SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "white"
|
### Context: CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR) ### Question: List all the product names with the color description "white". ### Answer: SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "white"
|
What are the name and typical buying and selling prices of the products that have color described as "yellow"?
|
CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR, typical_selling_price VARCHAR, color_code VARCHAR)
|
SELECT t1.product_name, t1.typical_buying_price, t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "yellow"
|
### Context: CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR, typical_selling_price VARCHAR, color_code VARCHAR) ### Question: What are the name and typical buying and selling prices of the products that have color described as "yellow"? ### Answer: SELECT t1.product_name, t1.typical_buying_price, t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "yellow"
|
How many characteristics does the product named "sesame" have?
|
CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR)
|
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame"
|
### Context: CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR) ### Question: How many characteristics does the product named "sesame" have? ### Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame"
|
How many distinct characteristic names does the product "cumin" have?
|
CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: How many distinct characteristic names does the product "cumin" have? ### Answer: SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
|
What are all the characteristic names of product "sesame"?
|
CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: What are all the characteristic names of product "sesame"? ### Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
|
List all the characteristic names and data types of product "cumin".
|
CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "cumin"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: List all the characteristic names and data types of product "cumin". ### Answer: SELECT t3.characteristic_name, t3.characteristic_data_type FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "cumin"
|
List all characteristics of product named "sesame" with type code "Grade".
|
CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR, characteristic_type_code VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" AND t3.characteristic_type_code = "Grade"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR, characteristic_type_code VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: List all characteristics of product named "sesame" with type code "Grade". ### Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" AND t3.characteristic_type_code = "Grade"
|
How many characteristics does the product named "laurel" have?
|
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "laurel"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: How many characteristics does the product named "laurel" have? ### Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "laurel"
|
Find the number of characteristics that the product "flax" has.
|
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "flax"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: Find the number of characteristics that the product "flax" has. ### Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "flax"
|
Find the name of the products that have the color description "red" and have the characteristic name "fast".
|
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "fast"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: Find the name of the products that have the color description "red" and have the characteristic name "fast". ### Answer: SELECT product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "fast"
|
How many products have the characteristic named "hot"?
|
CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "hot"
|
### Context: CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: How many products have the characteristic named "hot"? ### Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "hot"
|
List the all the distinct names of the products with the characteristic name 'warm'.
|
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "warm"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE products (product_name VARCHAR, product_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: List the all the distinct names of the products with the characteristic name 'warm'. ### Answer: SELECT DISTINCT t1.product_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t3.characteristic_name = "warm"
|
Find the number of the products that have their color described as "red" and have a characteristic named "slow".
|
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "slow"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: Find the number of the products that have their color described as "red" and have a characteristic named "slow". ### Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "slow"
|
Count the products that have the color description "white" or have the characteristic name "hot".
|
CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "white" OR t3.characteristic_name = "hot"
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_id VARCHAR, characteristic_name VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_id VARCHAR, color_code VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: Count the products that have the color description "white" or have the characteristic name "hot". ### Answer: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "white" OR t3.characteristic_name = "hot"
|
What is the unit of measuerment of the product category code "Herbs"?
|
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR)
|
SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
|
### Context: CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR) ### Question: What is the unit of measuerment of the product category code "Herbs"? ### Answer: SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
|
Find the product category description of the product category with code "Spices".
|
CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR)
|
SELECT product_category_description FROM ref_product_categories WHERE product_category_code = "Spices"
|
### Context: CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR) ### Question: Find the product category description of the product category with code "Spices". ### Answer: SELECT product_category_description FROM ref_product_categories WHERE product_category_code = "Spices"
|
What is the product category description and unit of measurement of category "Herbs"?
|
CREATE TABLE ref_product_categories (product_category_description VARCHAR, unit_of_measure VARCHAR, product_category_code VARCHAR)
|
SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
|
### Context: CREATE TABLE ref_product_categories (product_category_description VARCHAR, unit_of_measure VARCHAR, product_category_code VARCHAR) ### Question: What is the product category description and unit of measurement of category "Herbs"? ### Answer: SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
|
What is the unit of measurement of product named "cumin"?
|
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)
|
SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "cumin"
|
### Context: CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR) ### Question: What is the unit of measurement of product named "cumin"? ### Answer: SELECT t2.unit_of_measure FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "cumin"
|
Find the unit of measurement and product category code of product named "chervil".
|
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)
|
SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "chervil"
|
### Context: CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR) ### Question: Find the unit of measurement and product category code of product named "chervil". ### Answer: SELECT t2.unit_of_measure, t2.product_category_code FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code WHERE t1.product_name = "chervil"
|
Find the product names that are colored 'white' but do not have unit of measurement "Handful".
|
CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR, color_code VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE ref_product_categories (product_category_code VARCHAR, unit_of_measure VARCHAR)
|
SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = "white" AND t2.unit_of_measure <> "Handful"
|
### Context: CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR, color_code VARCHAR); CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE ref_product_categories (product_category_code VARCHAR, unit_of_measure VARCHAR) ### Question: Find the product names that are colored 'white' but do not have unit of measurement "Handful". ### Answer: SELECT t1.product_name FROM products AS t1 JOIN ref_product_categories AS t2 ON t1.product_category_code = t2.product_category_code JOIN ref_colors AS t3 ON t1.color_code = t3.color_code WHERE t3.color_description = "white" AND t2.unit_of_measure <> "Handful"
|
What is the description of the color for most products?
|
CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR)
|
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR) ### Question: What is the description of the color for most products? ### Answer: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1
|
What is the description of the color used by least products?
|
CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR)
|
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) LIMIT 1
|
### Context: CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR) ### Question: What is the description of the color used by least products? ### Answer: SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) LIMIT 1
|
What is the characteristic name used by most number of the products?
|
CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: What is the characteristic name used by most number of the products? ### Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name ORDER BY COUNT(*) DESC LIMIT 1
|
What are the names, details and data types of the characteristics which are never used by any product?
|
CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (characteristic_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR)
|
SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id
|
### Context: CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (characteristic_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, other_characteristic_details VARCHAR, characteristic_data_type VARCHAR) ### Question: What are the names, details and data types of the characteristics which are never used by any product? ### Answer: SELECT characteristic_name, other_characteristic_details, characteristic_data_type FROM CHARACTERISTICS EXCEPT SELECT t1.characteristic_name, t1.other_characteristic_details, t1.characteristic_data_type FROM CHARACTERISTICS AS t1 JOIN product_characteristics AS t2 ON t1.characteristic_id = t2.characteristic_id
|
What are characteristic names used at least twice across all products?
|
CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR)
|
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2
|
### Context: CREATE TABLE products (product_id VARCHAR); CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR, characteristic_id VARCHAR); CREATE TABLE product_characteristics (product_id VARCHAR, characteristic_id VARCHAR) ### Question: What are characteristic names used at least twice across all products? ### Answer: SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN CHARACTERISTICS AS t3 ON t2.characteristic_id = t3.characteristic_id GROUP BY t3.characteristic_name HAVING COUNT(*) >= 2
|
How many colors are never used by any product?
|
CREATE TABLE products (color_code VARCHAR); CREATE TABLE Ref_colors (color_code VARCHAR)
|
SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)
|
### Context: CREATE TABLE products (color_code VARCHAR); CREATE TABLE Ref_colors (color_code VARCHAR) ### Question: How many colors are never used by any product? ### Answer: SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)
|
How many events are there?
|
CREATE TABLE event (Id VARCHAR)
|
SELECT COUNT(*) FROM event
|
### Context: CREATE TABLE event (Id VARCHAR) ### Question: How many events are there? ### Answer: SELECT COUNT(*) FROM event
|
List all the event names by year from the most recent to the oldest.
|
CREATE TABLE event (name VARCHAR, YEAR VARCHAR)
|
SELECT name FROM event ORDER BY YEAR DESC
|
### Context: CREATE TABLE event (name VARCHAR, YEAR VARCHAR) ### Question: List all the event names by year from the most recent to the oldest. ### Answer: SELECT name FROM event ORDER BY YEAR DESC
|
What is the name of the event that happened in the most recent year?
|
CREATE TABLE event (name VARCHAR, YEAR VARCHAR)
|
SELECT name FROM event ORDER BY YEAR DESC LIMIT 1
|
### Context: CREATE TABLE event (name VARCHAR, YEAR VARCHAR) ### Question: What is the name of the event that happened in the most recent year? ### Answer: SELECT name FROM event ORDER BY YEAR DESC LIMIT 1
|
How many stadiums are there?
|
CREATE TABLE stadium (Id VARCHAR)
|
SELECT COUNT(*) FROM stadium
|
### Context: CREATE TABLE stadium (Id VARCHAR) ### Question: How many stadiums are there? ### Answer: SELECT COUNT(*) FROM stadium
|
Find the name of the stadium that has the maximum capacity.
|
CREATE TABLE stadium (name VARCHAR, capacity VARCHAR)
|
SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1
|
### Context: CREATE TABLE stadium (name VARCHAR, capacity VARCHAR) ### Question: Find the name of the stadium that has the maximum capacity. ### Answer: SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1
|
Find the names of stadiums whose capacity is smaller than the average capacity.
|
CREATE TABLE stadium (name VARCHAR, capacity INTEGER)
|
SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium)
|
### Context: CREATE TABLE stadium (name VARCHAR, capacity INTEGER) ### Question: Find the names of stadiums whose capacity is smaller than the average capacity. ### Answer: SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium)
|
Find the country that has the most stadiums.
|
CREATE TABLE stadium (country VARCHAR)
|
SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE stadium (country VARCHAR) ### Question: Find the country that has the most stadiums. ### Answer: SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
|
Which country has at most 3 stadiums listed?
|
CREATE TABLE stadium (country VARCHAR)
|
SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3
|
### Context: CREATE TABLE stadium (country VARCHAR) ### Question: Which country has at most 3 stadiums listed? ### Answer: SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3
|
Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?
|
CREATE TABLE stadium (country VARCHAR, capacity INTEGER)
|
SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000
|
### Context: CREATE TABLE stadium (country VARCHAR, capacity INTEGER) ### Question: Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000? ### Answer: SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000
|
How many cities have a stadium that was opened before the year of 2006?
|
CREATE TABLE stadium (city VARCHAR, opening_year INTEGER)
|
SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006
|
### Context: CREATE TABLE stadium (city VARCHAR, opening_year INTEGER) ### Question: How many cities have a stadium that was opened before the year of 2006? ### Answer: SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006
|
How many stadiums does each country have?
|
CREATE TABLE stadium (country VARCHAR)
|
SELECT country, COUNT(*) FROM stadium GROUP BY country
|
### Context: CREATE TABLE stadium (country VARCHAR) ### Question: How many stadiums does each country have? ### Answer: SELECT country, COUNT(*) FROM stadium GROUP BY country
|
Which countries do not have a stadium that was opened after 2006?
|
CREATE TABLE stadium (country VARCHAR, opening_year INTEGER)
|
SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006
|
### Context: CREATE TABLE stadium (country VARCHAR, opening_year INTEGER) ### Question: Which countries do not have a stadium that was opened after 2006? ### Answer: SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006
|
How many stadiums are not in country "Russia"?
|
CREATE TABLE stadium (country VARCHAR)
|
SELECT COUNT(*) FROM stadium WHERE country <> 'Russia'
|
### Context: CREATE TABLE stadium (country VARCHAR) ### Question: How many stadiums are not in country "Russia"? ### Answer: SELECT COUNT(*) FROM stadium WHERE country <> 'Russia'
|
Find the names of all swimmers, sorted by their 100 meter scores in ascending order.
|
CREATE TABLE swimmer (name VARCHAR, meter_100 VARCHAR)
|
SELECT name FROM swimmer ORDER BY meter_100
|
### Context: CREATE TABLE swimmer (name VARCHAR, meter_100 VARCHAR) ### Question: Find the names of all swimmers, sorted by their 100 meter scores in ascending order. ### Answer: SELECT name FROM swimmer ORDER BY meter_100
|
How many different countries are all the swimmers from?
|
CREATE TABLE swimmer (nationality VARCHAR)
|
SELECT COUNT(DISTINCT nationality) FROM swimmer
|
### Context: CREATE TABLE swimmer (nationality VARCHAR) ### Question: How many different countries are all the swimmers from? ### Answer: SELECT COUNT(DISTINCT nationality) FROM swimmer
|
List countries that have more than one swimmer.
|
CREATE TABLE swimmer (nationality VARCHAR)
|
SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1
|
### Context: CREATE TABLE swimmer (nationality VARCHAR) ### Question: List countries that have more than one swimmer. ### Answer: SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1
|
Find all 200 meter and 300 meter results of swimmers with nationality "Australia".
|
CREATE TABLE swimmer (meter_200 VARCHAR, meter_300 VARCHAR, nationality VARCHAR)
|
SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia'
|
### Context: CREATE TABLE swimmer (meter_200 VARCHAR, meter_300 VARCHAR, nationality VARCHAR) ### Question: Find all 200 meter and 300 meter results of swimmers with nationality "Australia". ### Answer: SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia'
|
Find the names of swimmers who has a result of "win".
|
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)
|
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'
|
### Context: CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR) ### Question: Find the names of swimmers who has a result of "win". ### Answer: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'
|
What is the name of the stadium which held the most events?
|
CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR)
|
SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR) ### Question: What is the name of the stadium which held the most events? ### Answer: SELECT t1.name FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1
|
Find the name and capacity of the stadium where the event named "World Junior" happened.
|
CREATE TABLE event (stadium_id VARCHAR, name VARCHAR); CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, id VARCHAR)
|
SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'
|
### Context: CREATE TABLE event (stadium_id VARCHAR, name VARCHAR); CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, id VARCHAR) ### Question: Find the name and capacity of the stadium where the event named "World Junior" happened. ### Answer: SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'
|
Find the names of stadiums which have never had any event.
|
CREATE TABLE stadium (name VARCHAR, id VARCHAR, stadium_id VARCHAR); CREATE TABLE event (name VARCHAR, id VARCHAR, stadium_id VARCHAR)
|
SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event)
|
### Context: CREATE TABLE stadium (name VARCHAR, id VARCHAR, stadium_id VARCHAR); CREATE TABLE event (name VARCHAR, id VARCHAR, stadium_id VARCHAR) ### Question: Find the names of stadiums which have never had any event. ### Answer: SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event)
|
Find the name of the swimmer who has the most records.
|
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)
|
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR) ### Question: Find the name of the swimmer who has the most records. ### Answer: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id ORDER BY COUNT(*) DESC LIMIT 1
|
Find the name of the swimmer who has at least 2 records.
|
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)
|
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING COUNT(*) >= 2
|
### Context: CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR) ### Question: Find the name of the swimmer who has at least 2 records. ### Answer: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id GROUP BY t2.swimmer_id HAVING COUNT(*) >= 2
|
Find the name and nationality of the swimmer who has won (i.e., has a result of "win") more than 1 time.
|
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, nationality VARCHAR, id VARCHAR)
|
SELECT t1.name, t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' GROUP BY t2.swimmer_id HAVING COUNT(*) > 1
|
### Context: CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, nationality VARCHAR, id VARCHAR) ### Question: Find the name and nationality of the swimmer who has won (i.e., has a result of "win") more than 1 time. ### Answer: SELECT t1.name, t1.nationality FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' GROUP BY t2.swimmer_id HAVING COUNT(*) > 1
|
Find the names of the swimmers who have no record.
|
CREATE TABLE swimmer (name VARCHAR, id VARCHAR, swimmer_id VARCHAR); CREATE TABLE record (name VARCHAR, id VARCHAR, swimmer_id VARCHAR)
|
SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record)
|
### Context: CREATE TABLE swimmer (name VARCHAR, id VARCHAR, swimmer_id VARCHAR); CREATE TABLE record (name VARCHAR, id VARCHAR, swimmer_id VARCHAR) ### Question: Find the names of the swimmers who have no record. ### Answer: SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record)
|
Find the names of the swimmers who have both "win" and "loss" results in the record.
|
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)
|
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss'
|
### Context: CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR) ### Question: Find the names of the swimmers who have both "win" and "loss" results in the record. ### Answer: SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win' INTERSECT SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Loss'
|
Find the names of stadiums that some Australian swimmers have been to.
|
CREATE TABLE swimmer (id VARCHAR, nationality VARCHAR); CREATE TABLE record (swimmer_id VARCHAR, event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (id VARCHAR, stadium_id VARCHAR)
|
SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia'
|
### Context: CREATE TABLE swimmer (id VARCHAR, nationality VARCHAR); CREATE TABLE record (swimmer_id VARCHAR, event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (id VARCHAR, stadium_id VARCHAR) ### Question: Find the names of stadiums that some Australian swimmers have been to. ### Answer: SELECT t4.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id JOIN event AS t3 ON t2.event_id = t3.id JOIN stadium AS t4 ON t4.id = t3.stadium_id WHERE t1.nationality = 'Australia'
|
Find the names of stadiums that the most swimmers have been to.
|
CREATE TABLE record (event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR, id VARCHAR)
|
SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1
|
### Context: CREATE TABLE record (event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR, id VARCHAR) ### Question: Find the names of stadiums that the most swimmers have been to. ### Answer: SELECT t3.name FROM record AS t1 JOIN event AS t2 ON t1.event_id = t2.id JOIN stadium AS t3 ON t3.id = t2.stadium_id GROUP BY t2.stadium_id ORDER BY COUNT(*) DESC LIMIT 1
|
Find all details for each swimmer.
|
CREATE TABLE swimmer (Id VARCHAR)
|
SELECT * FROM swimmer
|
### Context: CREATE TABLE swimmer (Id VARCHAR) ### Question: Find all details for each swimmer. ### Answer: SELECT * FROM swimmer
|
What is the average capacity of the stadiums that were opened in year 2005?
|
CREATE TABLE stadium (capacity INTEGER, opening_year VARCHAR)
|
SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005
|
### Context: CREATE TABLE stadium (capacity INTEGER, opening_year VARCHAR) ### Question: What is the average capacity of the stadiums that were opened in year 2005? ### Answer: SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.