cnatale/presto-athena-txt-2-sql huggingface dataset:
What are the different membership levels?
Additional table information: table: shop_membership
SQL: SELECT COUNT(DISTINCT LEVEL) FROM member
Show card number, name, and hometown for all members in a descending order of level.
Additional table information: table: shop_membership
SQL: SELECT card_number, name, hometown FROM member ORDER BY LEVEL DESC
What are the card numbers, names, and hometowns of every member ordered by descending level?
Additional table information: table: shop_membership
SQL: SELECT card_number, name, hometown FROM member ORDER BY LEVEL DESC
Show the membership level with most number of members.
Additional table information: table: shop_membership
SQL: SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY COUNT(*) DESC LIMIT 1
What is the membership level with the most people?
Additional table information: table: shop_membership
SQL: SELECT LEVEL FROM member GROUP BY LEVEL ORDER BY COUNT(*) DESC LIMIT 1
Show all member names and registered branch names sorted by register year.
Additional table information: table: shop_membership
SQL: SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year NULLS FIRST
What are the names of the members and branches at which they are registered sorted by year of registration?
Additional table information: table: shop_membership
SQL: SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year NULLS FIRST
Show all branch names with the number of members in each branch registered after 2015.
Additional table information: table: shop_membership
SQL: SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id
For each branch id, what are the names of the branches that were registered after 2015?
Additional table information: table: shop_membership
SQL: SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id
Show member names without any registered branch.
Additional table information: table: shop_membership
SQL: SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch)
What are the names of the members that have never registered at any branch?
Additional table information: table: shop_membership
SQL: SELECT name FROM member WHERE NOT member_id IN (SELECT member_id FROM membership_register_branch)
List the branch name and city without any registered members.
Additional table information: table: shop_membership
SQL: SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch)
What are the names and cities of the branches that do not have any registered members?
Additional table information: table: shop_membership
SQL: SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch)
What is the name and open year for the branch with most number of memberships registered in 2016?
Additional table information: table: shop_membership
SQL: SELECT T2.name, T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY COUNT(*) DESC LIMIT 1
What is the name and opening year for the branch that registered the most members in 2016?
Additional table information: table: shop_membership
SQL: SELECT T2.name, T2.open_year FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year = 2016 GROUP BY T2.branch_id ORDER BY COUNT(*) DESC LIMIT 1
Show the member name and hometown who registered a branch in 2016.
Additional table information: table: shop_membership
SQL: SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016
What are the member names and hometowns of those who registered at a branch in 2016?
Additional table information: table: shop_membership
SQL: SELECT T2.name, T2.hometown FROM membership_register_branch AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T1.register_year = 2016
Show all city with a branch opened in 2001 and a branch with more than 100 membership.
Additional table information: table: shop_membership
SQL: SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100
What are the cities that have a branch that opened in 2001 and a branch with more than 100 members?
Additional table information: table: shop_membership
SQL: SELECT city FROM branch WHERE open_year = 2001 AND membership_amount > 100
Show all cities without a branch having more than 100 memberships.
Additional table information: table: shop_membership
SQL: SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100
What are the cities that do not have any branches with more than 100 members?
Additional table information: table: shop_membership
SQL: SELECT city FROM branch EXCEPT SELECT city FROM branch WHERE membership_amount > 100
What is the sum of total pounds of purchase in year 2018 for all branches in London?
Additional table information: table: shop_membership
SQL: SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018
How many total pounds were purchased in the year 2018 at all London branches?
Additional table information: table: shop_membership
SQL: SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018
What is the total number of purchases for members with level 6?
Additional table information: table: shop_membership
SQL: SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
What are the total purchases for members rated at level 6?
Additional table information: table: shop_membership
SQL: SELECT COUNT(*) FROM purchase AS T1 JOIN member AS T2 ON T1.member_id = T2.member_id WHERE T2.level = 6
Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.
Additional table information: table: shop_membership
SQL: SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville ,  Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram ,  Georgia'
What are the names of the branches that have some members with a hometown in Louisville, Kentucky and also those from Hiram, Goergia?
Additional table information: table: shop_membership
SQL: SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Louisville ,  Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id WHERE T3.Hometown = 'Hiram ,  Georgia'
list the card number of all members whose hometown address includes word 'Kentucky'.
Additional table information: table: shop_membership
SQL: SELECT card_number FROM member WHERE Hometown LIKE '%Kentucky%'
What are the card numbers of members from Kentucky?
Additional table information: table: shop_membership
SQL: SELECT card_number FROM member WHERE Hometown LIKE '%Kentucky%'
Find the number of students in total.
Additional table information: table: voter_2
SQL: SELECT COUNT(*) FROM STUDENT
How many students are there in total?
Additional table information: table: voter_2
SQL: SELECT COUNT(*) FROM STUDENT
Find the number of voting records in total.
Additional table information: table: voter_2
SQL: SELECT COUNT(*) FROM VOTING_RECORD
How many voting records do we have?
Additional table information: table: voter_2
SQL: SELECT COUNT(*) FROM VOTING_RECORD
Find the distinct number of president votes.
Additional table information: table: voter_2
SQL: SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD
How many distinct president votes are recorded?
Additional table information: table: voter_2
SQL: SELECT COUNT(DISTINCT President_Vote) FROM VOTING_RECORD
Find the maximum age of all the students.
Additional table information: table: voter_2
SQL: SELECT MAX(Age) FROM STUDENT
What is the oldest age among the students?
Additional table information: table: voter_2
SQL: SELECT MAX(Age) FROM STUDENT
Find the last names of students with major 50.
Additional table information: table: voter_2
SQL: SELECT LName FROM STUDENT WHERE Major = 50
What are the last names of students studying major 50?
Additional table information: table: voter_2
SQL: SELECT LName FROM STUDENT WHERE Major = 50
Find the first names of students with age above 22.
Additional table information: table: voter_2
SQL: SELECT Fname FROM STUDENT WHERE Age > 22
What are the first names of all the students aged above 22?
Additional table information: table: voter_2
SQL: SELECT Fname FROM STUDENT WHERE Age > 22
What are the majors of male (sex is M) students?
Additional table information: table: voter_2
SQL: SELECT Major FROM STUDENT WHERE Sex = 'M'
List the major of each male student.
Additional table information: table: voter_2
SQL: SELECT Major FROM STUDENT WHERE Sex = 'M'
What is the average age of female (sex is F) students?
Additional table information: table: voter_2
SQL: SELECT AVG(Age) FROM STUDENT WHERE Sex = 'F'
Find the average age of female students.
Additional table information: table: voter_2
SQL: SELECT AVG(Age) FROM STUDENT WHERE Sex = 'F'
What are the maximum and minimum age of students with major 600?
Additional table information: table: voter_2
SQL: SELECT MAX(Age), MIN(Age) FROM STUDENT WHERE Major = 600
Tell me the ages of the oldest and youngest students studying major 600.
Additional table information: table: voter_2
SQL: 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'?
Additional table information: table: voter_2
SQL: SELECT Advisor FROM STUDENT WHERE city_code = 'BAL'
Show the advisors of the students whose city of residence has city code 'BAL'.
Additional table information: table: voter_2
SQL: SELECT Advisor FROM STUDENT WHERE city_code = 'BAL'
What are the distinct secretary votes in the fall election cycle?
Additional table information: table: voter_2
SQL: SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = 'Fall'
Return all the distinct secretary votes made in the fall election cycle.
Additional table information: table: voter_2
SQL: SELECT DISTINCT Secretary_Vote FROM VOTING_RECORD WHERE ELECTION_CYCLE = 'Fall'
What are the distinct president votes on 08/30/2015?
Additional table information: table: voter_2
SQL: SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = '08/30/2015'
Show all the distinct president votes made on 08/30/2015.
Additional table information: table: voter_2
SQL: SELECT DISTINCT PRESIDENT_Vote FROM VOTING_RECORD WHERE Registration_Date = '08/30/2015'
Report the distinct registration date and the election cycle.
Additional table information: table: voter_2
SQL: SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD
What are the distinct registration dates and the election cycles?
Additional table information: table: voter_2
SQL: SELECT DISTINCT Registration_Date, Election_Cycle FROM VOTING_RECORD
Report the distinct president vote and the vice president vote.
Additional table information: table: voter_2
SQL: SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD
List all the distinct president votes and the vice president votes.
Additional table information: table: voter_2
SQL: SELECT DISTINCT President_Vote, VICE_President_Vote FROM VOTING_RECORD
Find the distinct last names of the students who have class president votes.
Additional table information: table: voter_2
SQL: SELECT DISTINCT T1.LName FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_President_VOTE
What are the distinct last names of the students who have class president votes?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.CLASS_Senator_VOTE
What are the distinct first names of the students who have class president votes?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: SELECT DISTINCT T1.Age FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Secretary_Vote WHERE T2.Election_Cycle = 'Fall'
What are the distinct ages of students who have secretary votes in the fall election cycle?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: SELECT DISTINCT T1.Advisor FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote WHERE T2.Election_Cycle = 'Spring'
Who served as an advisor for students who have treasurer votes in the spring election cycle?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote
What are the distinct majors that students with treasurer votes are studying?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: 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'
What are the first and last names of all the female students who have president votes?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: 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
What are the first names and last names of the students who are 18 years old and have vice president votes.
Additional table information: table: voter_2
SQL: 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?
Additional table information: table: voter_2
SQL: 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'
Count the number of male students who had class senator votes in the fall election cycle.
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: 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'
Which students live in the city with code 'NYC' and have class senator votes in the spring election cycle? Count the numbers.
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: 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'
What is the average age of students who have city code 'NYC' and have secretary votes for the spring election cycle?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: 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'
What is the average age of the female students with secretary votes in the spring election cycle?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: 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'
What are the distinct first names of the students who have vice president votes and reside in a city whose city code is not PIT?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: 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'
What are the distinct last names of the students who have president votes but do not have 2192 as the advisor?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: 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'
What are the distinct last names of the students who have president votes and have 8741 as the advisor?
Additional table information: table: voter_2
SQL: 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.
Additional table information: table: voter_2
SQL: SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor
How many students does each advisor have?
Additional table information: table: voter_2
SQL: SELECT Advisor, COUNT(*) FROM STUDENT GROUP BY Advisor
Report all advisors that advise more than 2 students.
Additional table information: table: voter_2
SQL: SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
Which advisors have more than two students?
Additional table information: table: voter_2
SQL: SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
Report all majors that have less than 3 students.
Additional table information: table: voter_2
SQL: SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
What are the majors only less than three students are studying?
Additional table information: table: voter_2
SQL: SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
For each election cycle, report the number of voting records.
Additional table information: table: voter_2
SQL: SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle
Count the number of voting records for each election cycle.
Additional table information: table: voter_2
SQL: SELECT Election_Cycle, COUNT(*) FROM VOTING_RECORD GROUP BY Election_Cycle
Which major has the most students?
Additional table information: table: voter_2
SQL: SELECT Major FROM STUDENT GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
Find the major that is studied by the largest number of students.
Additional table information: table: voter_2
SQL: 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?
Additional table information: table: voter_2
SQL: SELECT Major FROM STUDENT WHERE Sex = 'F' GROUP BY major ORDER BY COUNT(*) DESC LIMIT 1
Find the major that is studied by the most female students.
Additional table information: table: voter_2
SQL: 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?
Additional table information: table: voter_2
SQL: SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1
Return the code of the city that has the most students.
Additional table information: table: voter_2
SQL: SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY COUNT(*) DESC LIMIT 1
Report the distinct advisors who have more than 2 students.
Additional table information: table: voter_2
SQL: SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
Which advisors are advising more than 2 students?
Additional table information: table: voter_2
SQL: SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
How many products are there?
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM products
Count the number of products.
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM products
How many colors are there?
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM ref_colors
Count the number of colors.
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM ref_colors
How many characteristics are there?
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM CHARACTERISTICS
Count the number of characteristics.
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM CHARACTERISTICS
What are the names and buying prices of all the products?
Additional table information: table: products_gen_characteristics
SQL: SELECT product_name, typical_buying_price FROM products
Return the names and typical buying prices for all products.
Additional table information: table: products_gen_characteristics
SQL: SELECT product_name, typical_buying_price FROM products
List the description of all the colors.
Additional table information: table: products_gen_characteristics
SQL: SELECT color_description FROM ref_colors
What are the descriptions for each color?
Additional table information: table: products_gen_characteristics
SQL: SELECT color_description FROM ref_colors
Find the names of all the product characteristics.
Additional table information: table: products_gen_characteristics
SQL: SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
What are the different names of the product characteristics?
Additional table information: table: products_gen_characteristics
SQL: SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
What are the names of products with category 'Spices'?
Additional table information: table: products_gen_characteristics
SQL: SELECT product_name FROM products WHERE product_category_code = 'Spices'
Return the names of products in the category 'Spices'.
Additional table information: table: products_gen_characteristics
SQL: SELECT product_name FROM products WHERE product_category_code = 'Spices'
List the names, color descriptions and product descriptions of products with category 'Herbs'.
Additional table information: table: products_gen_characteristics
SQL: 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'
What are the names, color descriptions, and product descriptions for products in the 'Herbs' category?
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM products WHERE product_category_code = 'Seeds'
Count the number of products in the category 'Seeds'.
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM products WHERE product_category_code = 'Seeds'
Find the number of products with category 'Spices' and typically sold above 1000.
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM products WHERE product_category_code = 'Spices' AND typical_buying_price > 1000
How many products are in the 'Spices' category and have a typical price of over 1000?
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: SELECT product_category_code, typical_buying_price FROM products WHERE product_name = 'cumin'
Return the category code and typical price of 'cumin'.
Additional table information: table: products_gen_characteristics
SQL: SELECT product_category_code, typical_buying_price FROM products WHERE product_name = 'cumin'
Which category does the product named 'flax' belong to?
Additional table information: table: products_gen_characteristics
SQL: SELECT product_category_code FROM products WHERE product_name = 'flax'
What is the code of the category that the product with the name 'flax' belongs to?
Additional table information: table: products_gen_characteristics
SQL: SELECT product_category_code FROM products WHERE product_name = 'flax'
What is the name of the product with the color description 'yellow'?
Additional table information: table: products_gen_characteristics
SQL: 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'
Give the name of the products that have a color description 'yellow'.
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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 are the descriptions of the categories that products with product descriptions that contain the letter t are in?
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: 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'
Give the color description for the product 'catnip'.
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: 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'
Return the color code and description for the product with the name 'chervil'.
Additional table information: table: products_gen_characteristics
SQL: 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.
Additional table information: table: products_gen_characteristics
SQL: 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
What are the product ids and color descriptions for products with two or more characteristics?
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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 names of products with 'white' as their color description?
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: 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'
Return the names and typical buying and selling prices for products that have 'yellow' as their color description.
Additional table information: table: products_gen_characteristics
SQL: 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?
Additional table information: table: products_gen_characteristics
SQL: SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id WHERE t1.product_name = 'sesame'
Count the number of characteristics the product 'sesame' has.
Additional table information: table: products_gen_characteristics
SQL: 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?
Additional table information: table: products_gen_characteristics
SQL: 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'
Count the number of different characteristic names the product 'cumin' has.
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: 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'
Return the characteristic names of the 'sesame' product.
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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'
What are the names and data types of the characteristics of the 'cumin' product?
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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'
What are the names of the characteristics of the product 'sesame' that have the characteristic type code 'Grade'?
Additional table information: table: products_gen_characteristics
SQL: 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?
Additional table information: table: products_gen_characteristics
SQL: 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'
Count the number of characteristics of the product named 'laurel'.
Additional table information: table: products_gen_characteristics
SQL: 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.
Additional table information: table: products_gen_characteristics
SQL: 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'
Count the number of characteristics of the 'flax' product.
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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'
What are the names of the products that have a color description of 'red' and the 'fast' characteristic?
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: 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'
Count the number of products with the 'hot' charactersitic.
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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'
What are the different product names for products that have the 'warm' characteristic:?
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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'
How many products have the color description 'red' and the characteristic name 'slow'?
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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'
How many products have their color described as 'white' or have a characteristic with the name 'hot'?
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'
Return the unit of measure for 'Herb' products.
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: SELECT product_category_description FROM ref_product_categories WHERE product_category_code = 'Spices'
What is the description of the product category with the code 'Spices'?
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: SELECT product_category_description, unit_of_measure FROM ref_product_categories WHERE product_category_code = 'Herbs'
Return the description and unit of measurement for products in the 'Herbs' category.
Additional table information: table: products_gen_characteristics
SQL: 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'?
Additional table information: table: products_gen_characteristics
SQL: 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'
Give the unit of measure for the product with the name 'cumin'.
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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'
What are the unit of measure and category code for the 'chervil' product?
Additional table information: table: products_gen_characteristics
SQL: 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'.
Additional table information: table: products_gen_characteristics
SQL: 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 are the names of products that are not 'white' in color and are not measured by the unit 'Handful'?
Additional table information: table: products_gen_characteristics
SQL: 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?
Additional table information: table: products_gen_characteristics
SQL: 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
Return the color description that is most common across all products.
Additional table information: table: products_gen_characteristics
SQL: 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?
Additional table information: table: products_gen_characteristics
SQL: 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(*) ASC NULLS FIRST LIMIT 1
Give the color description that is least common across products.
Additional table information: table: products_gen_characteristics
SQL: 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(*) ASC NULLS FIRST LIMIT 1
What is the characteristic name used by most number of the products?
Additional table information: table: products_gen_characteristics
SQL: 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
Return the name of the characteristic that is most common across all products.
Additional table information: table: products_gen_characteristics
SQL: 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?
Additional table information: table: products_gen_characteristics
SQL: 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
Give the names, details, and data types of characteristics that are not found in any product.
Additional table information: table: products_gen_characteristics
SQL: 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?
Additional table information: table: products_gen_characteristics
SQL: 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