answer
stringlengths
18
557
context
stringlengths
27
489
question
stringlengths
12
244
text
stringlengths
275
1.7k
SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600
CREATE TABLE STUDENT (Age INTEGER, Major VARCHAR)
What are the maximum and minimum age of students with major 600?
<s>[INST] Given the following SQL query and context: Query: SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600 Context: CREATE TABLE STUDENT (Age INTEGER, Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the maximum and minimum age of students with major 600? The answ...
SELECT Advisor FROM STUDENT WHERE city_code = "BAL"
CREATE TABLE STUDENT (Advisor VARCHAR, city_code VARCHAR)
Who are the advisors for students that live in a city with city code "BAL"?
<s>[INST] Given the following SQL query and context: Query: SELECT Advisor FROM STUDENT WHERE city_code = "BAL" Context: CREATE TABLE STUDENT (Advisor VARCHAR, city_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Who are the advisors for students that live in a city with city code "...
SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = "Fall"
CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, ELECTION_CYCLE VARCHAR)
What are the distinct secretary votes in the fall election cycle?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = "Fall" Context: CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, ELECTION_CYCLE VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the distinct se...
SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = "08/30/2015"
CREATE TABLE VOTING_RECORD (PRESIDENT_Vote VARCHAR, Registration_Date VARCHAR)
What are the distinct president votes on 08/30/2015?
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = "08/30/2015" Context: CREATE TABLE VOTING_RECORD (PRESIDENT_Vote VARCHAR, Registration_Date VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the...
SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD
CREATE TABLE VOTING_RECORD (Registration_Date VARCHAR, Election_Cycle VARCHAR)
Report the distinct registration date and the election cycle.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD Context: CREATE TABLE VOTING_RECORD (Registration_Date VARCHAR, Election_Cycle VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Report the distinct registration...
SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD
CREATE TABLE VOTING_RECORD (President_Vote VARCHAR, VICE_President_Vote VARCHAR)
Report the distinct president vote and the vice president vote.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD Context: CREATE TABLE VOTING_RECORD (President_Vote VARCHAR, VICE_President_Vote VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Report the distinct presiden...
SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE
CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_President_VOTE VARCHAR)
Find the distinct last names of the students who have class president votes.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL...
SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE
CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (CLASS_Senator_VOTE VARCHAR)
Find the distinct first names of the students who have class senator votes.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL que...
SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = "Fall"
CREATE TABLE VOTING_RECORD (Secretary_Vote VARCHAR, Election_Cycle VARCHAR); CREATE TABLE STUDENT (Age VARCHAR, StuID VARCHAR)
Find the distinct ages of students who have secretary votes in the fall election cycle.
<s>[INST] Given the following SQL query and context: Query: 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 V...
SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = "Spring"
CREATE TABLE STUDENT (Advisor VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR, Election_Cycle VARCHAR)
Find the distinct Advisor of students who have treasurer votes in the spring election cycle.
<s>[INST] Given the following SQL query and context: Query: 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, Electi...
SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote
CREATE TABLE VOTING_RECORD (Treasurer_Vote VARCHAR); CREATE TABLE STUDENT (Major VARCHAR, StuID VARCHAR)
Find the distinct majors of students who have treasurer votes.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query and c...
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"
CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, sex VARCHAR); CREATE TABLE VOTING_RECORD (President_VOTE VARCHAR)
Find the first and last names of all the female (sex is F) students who have president votes.
<s>[INST] Given the following SQL query and context: Query: 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_VO...
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
CREATE TABLE STUDENT (Fname VARCHAR, LName VARCHAR, StuID VARCHAR, age VARCHAR); CREATE TABLE VOTING_RECORD (VICE_President_VOTE VARCHAR)
Find the first and last name of all the students of age 18 who have vice president votes.
<s>[INST] Given the following SQL query and context: Query: 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_Pre...
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"
CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR); CREATE TABLE STUDENT (StuID VARCHAR, Sex VARCHAR)
How many male (sex is M) students have class senator votes in the fall election cycle?
<s>[INST] Given the following SQL query and context: Query: 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) [/INS...
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"
CREATE TABLE STUDENT (StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)
Find the number of students whose city code is NYC and who have class senator votes in the spring election cycle.
<s>[INST] Given the following SQL query and context: Query: 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_Cycl...
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"
CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, city_code VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)
Find the average age of students who live in the city with code "NYC" and have secretary votes in the spring election cycle.
<s>[INST] Given the following SQL query and context: Query: 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 (E...
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"
CREATE TABLE STUDENT (Age INTEGER, StuID VARCHAR, Sex VARCHAR); CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)
Find the average age of female (sex is F) students who have secretary votes in the spring election cycle.
<s>[INST] Given the following SQL query and context: Query: 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 ...
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"
CREATE TABLE STUDENT (Fname VARCHAR, city_code VARCHAR); CREATE TABLE STUDENT (Fname VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (VICE_PRESIDENT_Vote VARCHAR)
Find the distinct first names of all the students who have vice president votes and whose city code is not PIT.
<s>[INST] Given the following SQL query and context: Query: 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 (...
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"
CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR)
Find the distinct last names of all the students who have president votes and whose advisor is not 2192.
<s>[INST] Given the following SQL query and context: Query: 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 TA...
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"
CREATE TABLE STUDENT (LName VARCHAR, PRESIDENT_Vote VARCHAR, Advisor VARCHAR); CREATE TABLE STUDENT (LName VARCHAR, StuID VARCHAR); CREATE TABLE VOTING_RECORD (Id VARCHAR)
Find the distinct last names of all the students who have president votes and whose advisor is 8741.
<s>[INST] Given the following SQL query and context: Query: 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...
SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor
CREATE TABLE STUDENT (Advisor VARCHAR)
For each advisor, report the total number of students advised by him or her.
<s>[INST] Given the following SQL query and context: Query: SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor Context: CREATE TABLE STUDENT (Advisor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For each advisor, report the total number of students advised by him or her. The answe...
SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
CREATE TABLE STUDENT (Advisor VARCHAR)
Report all advisors that advise more than 2 students.
<s>[INST] Given the following SQL query and context: Query: SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2 Context: CREATE TABLE STUDENT (Advisor VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Report all advisors that advise more than 2 students. The answer to your que...
SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
CREATE TABLE STUDENT (Major VARCHAR)
Report all majors that have less than 3 students.
<s>[INST] Given the following SQL query and context: Query: SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3 Context: CREATE TABLE STUDENT (Major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Report all majors that have less than 3 students. The answer to your question is: ...
SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle
CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR)
For each election cycle, report the number of voting records.
<s>[INST] Given the following SQL query and context: Query: SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle Context: CREATE TABLE VOTING_RECORD (Election_Cycle VARCHAR) [/INST] Based on the provided SQL query and context, your question is: For each election cycle, report the number of voting ...
SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR)
Which major has the most students?
<s>[INST] Given the following SQL query and context: Query: SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which major has the most students? The answer to your qu...
SELECT Major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE STUDENT (Major VARCHAR, major VARCHAR, Sex VARCHAR)
What is the most common major among female (sex is F) students?
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query and context, your question is: What is the most common maj...
SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE STUDENT (city_code VARCHAR)
What is the city_code of the city that the most students live in?
<s>[INST] Given the following SQL query and context: Query: SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE STUDENT (city_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the city_code of the city that the most students li...
SELECT COUNT(*) FROM products
CREATE TABLE products (Id VARCHAR)
How many products are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM products Context: CREATE TABLE products (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many products are there? The answer to your question is: SELECT COUNT(*) FROM products. [/s>
SELECT COUNT(*) FROM ref_colors
CREATE TABLE ref_colors (Id VARCHAR)
How many colors are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM ref_colors Context: CREATE TABLE ref_colors (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many colors are there? The answer to your question is: SELECT COUNT(*) FROM ref_colors. [/s>
SELECT COUNT(*) FROM CHARACTERISTICS
CREATE TABLE CHARACTERISTICS (Id VARCHAR)
How many characteristics are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM CHARACTERISTICS Context: CREATE TABLE CHARACTERISTICS (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many characteristics are there? The answer to your question is: SELECT COUNT(*) FROM CHARACTERIST...
SELECT product_name, typical_buying_price FROM products
CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR)
What are the names and buying prices of all the products?
<s>[INST] Given the following SQL query and context: Query: SELECT product_name, typical_buying_price FROM products Context: CREATE TABLE products (product_name VARCHAR, typical_buying_price VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names and buying prices of all the p...
SELECT color_description FROM ref_colors
CREATE TABLE ref_colors (color_description VARCHAR)
List the description of all the colors.
<s>[INST] Given the following SQL query and context: Query: SELECT color_description FROM ref_colors Context: CREATE TABLE ref_colors (color_description VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List the description of all the colors. The answer to your question is: SELECT color_de...
SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR)
Find the names of all the product characteristics.
<s>[INST] Given the following SQL query and context: Query: SELECT DISTINCT characteristic_name FROM CHARACTERISTICS Context: CREATE TABLE CHARACTERISTICS (characteristic_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all the product characteristics. The answer to...
SELECT product_name FROM products WHERE product_category_code = "Spices"
CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR)
What are the names of products with category "Spices"?
<s>[INST] Given the following SQL query and context: Query: SELECT product_name FROM products WHERE product_category_code = "Spices" Context: CREATE TABLE products (product_name VARCHAR, product_category_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What are the names of products ...
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"
CREATE TABLE Ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (product_name VARCHAR, product_description VARCHAR, color_code VARCHAR)
List the names, color descriptions and product descriptions of products with category "Herbs".
<s>[INST] Given the following SQL query and context: Query: 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 VARCHA...
SELECT COUNT(*) FROM products WHERE product_category_code = "Seeds"
CREATE TABLE products (product_category_code VARCHAR)
How many products are there under the category "Seeds"?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM products WHERE product_category_code = "Seeds" Context: CREATE TABLE products (product_category_code VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many products are there under the category "Seeds"? Th...
SELECT COUNT(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000
CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR)
Find the number of products with category "Spices" and typically sold above 1000.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query and context, your question...
SELECT product_category_code, typical_buying_price FROM products WHERE product_name = "cumin"
CREATE TABLE products (product_category_code VARCHAR, typical_buying_price VARCHAR, product_name VARCHAR)
What is the category and typical buying price of the product with name "cumin"?
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query and context...
SELECT product_category_code FROM products WHERE product_name = "flax"
CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)
Which category does the product named "flax" belong to?
<s>[INST] Given the following SQL query and context: Query: SELECT product_category_code FROM products WHERE product_name = "flax" Context: CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which category does the product n...
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'
CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR)
What is the name of the product with the color description 'yellow'?
<s>[INST] Given the following SQL query and context: Query: 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 VARCHA...
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%'
CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_description VARCHAR)
Find the category descriptions of the products whose descriptions include letter 't'.
<s>[INST] Given the following SQL query and context: Query: 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_descripti...
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"
CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR)
What is the color description of the product with name "catnip"?
<s>[INST] Given the following SQL query and context: Query: 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 VARCHA...
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"
CREATE TABLE products (color_code VARCHAR, product_name VARCHAR); CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR)
What is the color code and description of the product named "chervil"?
<s>[INST] Given the following SQL query and context: Query: 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_de...
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
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)
Find the id and color description of the products with at least 2 characteristics.
<s>[INST] Given the following SQL query and context: Query: 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_...
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"
CREATE TABLE ref_colors (color_code VARCHAR, color_description VARCHAR); CREATE TABLE products (product_name VARCHAR, color_code VARCHAR)
List all the product names with the color description "white".
<s>[INST] Given the following SQL query and context: Query: 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...
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"
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)
What are the name and typical buying and selling prices of the products that have color described as "yellow"?
<s>[INST] Given the following SQL query and context: Query: 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 V...
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = "sesame"
CREATE TABLE product_characteristics (product_id VARCHAR); CREATE TABLE products (product_id VARCHAR, product_name VARCHAR)
How many characteristics does the product named "sesame" have?
<s>[INST] Given the following SQL query and context: Query: 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...
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"
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)
How many distinct characteristic names does the product "cumin" have?
<s>[INST] Given the following SQL query and context: Query: 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 TAB...
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"
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)
What are all the characteristic names of product "sesame"?
<s>[INST] Given the following SQL query and context: Query: 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 CHARACTERISTI...
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"
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)
List all the characteristic names and data types of product "cumin".
<s>[INST] Given the following SQL query and context: Query: 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...
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"
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)
List all characteristics of product named "sesame" with type code "Grade".
<s>[INST] Given the following SQL query and context: Query: 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 = "...
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"
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)
How many characteristics does the product named "laurel" have?
<s>[INST] Given the following SQL query and context: Query: 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 (characteri...
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"
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)
Find the number of characteristics that the product "flax" has.
<s>[INST] Given the following SQL query and context: Query: 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 (characterist...
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"
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)
Find the name of the products that have the color description "red" and have the characteristic name "fast".
<s>[INST] Given the following SQL query and context: Query: 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_descript...
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"
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)
How many products have the characteristic named "hot"?
<s>[INST] Given the following SQL query and context: Query: 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 VA...
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"
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)
List the all the distinct names of the products with the characteristic name 'warm'.
<s>[INST] Given the following SQL query and context: Query: 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 CHARAC...
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"
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)
Find the number of the products that have their color described as "red" and have a characteristic named "slow".
<s>[INST] Given the following SQL query and context: Query: 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 ...
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"
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)
Count the products that have the color description "white" or have the characteristic name "hot".
<s>[INST] Given the following SQL query and context: Query: 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 ...
SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR)
What is the unit of measuerment of the product category code "Herbs"?
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query and context, your question is...
SELECT product_category_description FROM ref_product_categories WHERE product_category_code = "Spices"
CREATE TABLE ref_product_categories (product_category_description VARCHAR, product_category_code VARCHAR)
Find the product category description of the product category with code "Spices".
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query an...
SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
CREATE TABLE ref_product_categories (product_category_description VARCHAR, unit_of_measure VARCHAR, product_category_code VARCHAR)
What is the product category description and unit of measurement of category "Herbs"?
<s>[INST] Given the following SQL query and context: Query: 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) [...
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"
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)
What is the unit of measurement of product named "cumin"?
<s>[INST] Given the following SQL query and context: Query: 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 ...
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"
CREATE TABLE ref_product_categories (unit_of_measure VARCHAR, product_category_code VARCHAR); CREATE TABLE products (product_category_code VARCHAR, product_name VARCHAR)
Find the unit of measurement and product category code of product named "chervil".
<s>[INST] Given the following SQL query and context: Query: 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 VAR...
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"
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)
Find the product names that are colored 'white' but do not have unit of measurement "Handful".
<s>[INST] Given the following SQL query and context: Query: 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" ...
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
CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR)
What is the description of the color for most products?
<s>[INST] Given the following SQL query and context: Query: 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 p...
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
CREATE TABLE ref_colors (color_description VARCHAR, color_code VARCHAR); CREATE TABLE products (color_code VARCHAR)
What is the description of the color used by least products?
<s>[INST] Given the following SQL query and context: Query: 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 produc...
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
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)
What is the characteristic name used by most number of the products?
<s>[INST] Given the following SQL query and context: Query: 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 Conte...
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
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...
What are the names, details and data types of the characteristics which are never used by any product?
<s>[INST] Given the following SQL query and context: Query: 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 A...
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
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)
What are characteristic names used at least twice across all products?
<s>[INST] Given the following SQL query and context: Query: 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...
SELECT COUNT(*) FROM Ref_colors WHERE NOT color_code IN (SELECT color_code FROM products)
CREATE TABLE products (color_code VARCHAR); CREATE TABLE Ref_colors (color_code VARCHAR)
How many colors are never used by any product?
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query and context, your question is: H...
SELECT COUNT(*) FROM event
CREATE TABLE event (Id VARCHAR)
How many events are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM event Context: CREATE TABLE event (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many events are there? The answer to your question is: SELECT COUNT(*) FROM event. [/s>
SELECT name FROM event ORDER BY YEAR DESC
CREATE TABLE event (name VARCHAR, YEAR VARCHAR)
List all the event names by year from the most recent to the oldest.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM event ORDER BY YEAR DESC Context: CREATE TABLE event (name VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List all the event names by year from the most recent to the oldest. The answer to your qu...
SELECT name FROM event ORDER BY YEAR DESC LIMIT 1
CREATE TABLE event (name VARCHAR, YEAR VARCHAR)
What is the name of the event that happened in the most recent year?
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM event ORDER BY YEAR DESC LIMIT 1 Context: CREATE TABLE event (name VARCHAR, YEAR VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the name of the event that happened in the most recent year? The answer to...
SELECT COUNT(*) FROM stadium
CREATE TABLE stadium (Id VARCHAR)
How many stadiums are there?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM stadium Context: CREATE TABLE stadium (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many stadiums are there? The answer to your question is: SELECT COUNT(*) FROM stadium. [/s>
SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1
CREATE TABLE stadium (name VARCHAR, capacity VARCHAR)
Find the name of the stadium that has the maximum capacity.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1 Context: CREATE TABLE stadium (name VARCHAR, capacity VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the name of the stadium that has the maximum capacity. The answer...
SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium)
CREATE TABLE stadium (name VARCHAR, capacity INTEGER)
Find the names of stadiums whose capacity is smaller than the average capacity.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM stadium WHERE capacity < (SELECT AVG(capacity) FROM stadium) Context: CREATE TABLE stadium (name VARCHAR, capacity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Find the names of stadiums whose capacity is sma...
SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE stadium (country VARCHAR)
Find the country that has the most stadiums.
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM stadium GROUP BY country ORDER BY COUNT(*) DESC LIMIT 1 Context: CREATE TABLE stadium (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the country that has the most stadiums. The answer to your q...
SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3
CREATE TABLE stadium (country VARCHAR)
Which country has at most 3 stadiums listed?
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM stadium GROUP BY country HAVING COUNT(*) <= 3 Context: CREATE TABLE stadium (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Which country has at most 3 stadiums listed? The answer to your question is...
SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000
CREATE TABLE stadium (country VARCHAR, capacity INTEGER)
Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000 Context: CREATE TABLE stadium (country VARCHAR, capacity INTEGER) [/INST] Based on the provided SQL query and context, your question is: Which count...
SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006
CREATE TABLE stadium (city VARCHAR, opening_year INTEGER)
How many cities have a stadium that was opened before the year of 2006?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT city) FROM stadium WHERE opening_year < 2006 Context: CREATE TABLE stadium (city VARCHAR, opening_year INTEGER) [/INST] Based on the provided SQL query and context, your question is: How many cities have a stadium that was opened before t...
SELECT country, COUNT(*) FROM stadium GROUP BY country
CREATE TABLE stadium (country VARCHAR)
How many stadiums does each country have?
<s>[INST] Given the following SQL query and context: Query: SELECT country, COUNT(*) FROM stadium GROUP BY country Context: CREATE TABLE stadium (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many stadiums does each country have? The answer to your question is: SELECT count...
SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006
CREATE TABLE stadium (country VARCHAR, opening_year INTEGER)
Which countries do not have a stadium that was opened after 2006?
<s>[INST] Given the following SQL query and context: Query: SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006 Context: CREATE TABLE stadium (country VARCHAR, opening_year INTEGER) [/INST] Based on the provided SQL query and context, your question is: Which countries do not have a ...
SELECT COUNT(*) FROM stadium WHERE country <> 'Russia'
CREATE TABLE stadium (country VARCHAR)
How many stadiums are not in country "Russia"?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(*) FROM stadium WHERE country <> 'Russia' Context: CREATE TABLE stadium (country VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many stadiums are not in country "Russia"? The answer to your question is: SELECT ...
SELECT name FROM swimmer ORDER BY meter_100
CREATE TABLE swimmer (name VARCHAR, meter_100 VARCHAR)
Find the names of all swimmers, sorted by their 100 meter scores in ascending order.
<s>[INST] Given the following SQL query and context: Query: SELECT name FROM swimmer ORDER BY meter_100 Context: CREATE TABLE swimmer (name VARCHAR, meter_100 VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find the names of all swimmers, sorted by their 100 meter scores in ascending ord...
SELECT COUNT(DISTINCT nationality) FROM swimmer
CREATE TABLE swimmer (nationality VARCHAR)
How many different countries are all the swimmers from?
<s>[INST] Given the following SQL query and context: Query: SELECT COUNT(DISTINCT nationality) FROM swimmer Context: CREATE TABLE swimmer (nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: How many different countries are all the swimmers from? The answer to your question is: S...
SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1
CREATE TABLE swimmer (nationality VARCHAR)
List countries that have more than one swimmer.
<s>[INST] Given the following SQL query and context: Query: SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1 Context: CREATE TABLE swimmer (nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: List countries that have more than one swimmer. The an...
SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia'
CREATE TABLE swimmer (meter_200 VARCHAR, meter_300 VARCHAR, nationality VARCHAR)
Find all 200 meter and 300 meter results of swimmers with nationality "Australia".
<s>[INST] Given the following SQL query and context: Query: SELECT meter_200, meter_300 FROM swimmer WHERE nationality = 'Australia' Context: CREATE TABLE swimmer (meter_200 VARCHAR, meter_300 VARCHAR, nationality VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all 200 meter and 300...
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)
Find the names of swimmers who has a result of "win".
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query and context, your quest...
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
CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR)
What is the name of the stadium which held the most events?
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQ...
SELECT t1.name, t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'
CREATE TABLE event (stadium_id VARCHAR, name VARCHAR); CREATE TABLE stadium (name VARCHAR, capacity VARCHAR, id VARCHAR)
Find the name and capacity of the stadium where the event named "World Junior" happened.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Ba...
SELECT name FROM stadium WHERE NOT id IN (SELECT stadium_id FROM event)
CREATE TABLE stadium (name VARCHAR, id VARCHAR, stadium_id VARCHAR); CREATE TABLE event (name VARCHAR, id VARCHAR, stadium_id VARCHAR)
Find the names of stadiums which have never had any event.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query and ...
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
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)
Find the name of the swimmer who has the most records.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided ...
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
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)
Find the name of the swimmer who has at least 2 records.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query ...
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
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, nationality VARCHAR, id VARCHAR)
Find the name and nationality of the swimmer who has won (i.e., has a result of "win") more than 1 time.
<s>[INST] Given the following SQL query and context: Query: 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 VARC...
SELECT name FROM swimmer WHERE NOT id IN (SELECT swimmer_id FROM record)
CREATE TABLE swimmer (name VARCHAR, id VARCHAR, swimmer_id VARCHAR); CREATE TABLE record (name VARCHAR, id VARCHAR, swimmer_id VARCHAR)
Find the names of the swimmers who have no record.
<s>[INST] Given the following SQL query and context: Query: 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) [/INST] Based on the provided SQL query an...
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'
CREATE TABLE record (swimmer_id VARCHAR); CREATE TABLE swimmer (name VARCHAR, id VARCHAR)
Find the names of the swimmers who have both "win" and "loss" results in the record.
<s>[INST] Given the following SQL query and context: Query: 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); CR...
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'
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)
Find the names of stadiums that some Australian swimmers have been to.
<s>[INST] Given the following SQL query and context: Query: 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);...
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
CREATE TABLE record (event_id VARCHAR); CREATE TABLE stadium (name VARCHAR, id VARCHAR); CREATE TABLE event (stadium_id VARCHAR, id VARCHAR)
Find the names of stadiums that the most swimmers have been to.
<s>[INST] Given the following SQL query and context: Query: 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 V...
SELECT * FROM swimmer
CREATE TABLE swimmer (Id VARCHAR)
Find all details for each swimmer.
<s>[INST] Given the following SQL query and context: Query: SELECT * FROM swimmer Context: CREATE TABLE swimmer (Id VARCHAR) [/INST] Based on the provided SQL query and context, your question is: Find all details for each swimmer. The answer to your question is: SELECT * FROM swimmer. [/s>
SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005
CREATE TABLE stadium (capacity INTEGER, opening_year VARCHAR)
What is the average capacity of the stadiums that were opened in year 2005?
<s>[INST] Given the following SQL query and context: Query: SELECT AVG(capacity) FROM stadium WHERE opening_year = 2005 Context: CREATE TABLE stadium (capacity INTEGER, opening_year VARCHAR) [/INST] Based on the provided SQL query and context, your question is: What is the average capacity of the stadiums that were ope...