target-benchmark/spider-queries huggingface dataset:
Database: products_gen_characteristics (tables: ref_colors, products)
Question: Give the color description for the product 'catnip'.
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"
Database: products_gen_characteristics (tables: ref_colors, products)
Question: What is the color code and description of the product named "chervil"?
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"
Database: products_gen_characteristics (tables: ref_colors, products)
Question: Return the color code and description for the product with the name 'chervil'.
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"
Database: products_gen_characteristics (tables: ref_colors, products, product_characteristics)
Question: Find the id and color description of the products with at least 2 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
Database: products_gen_characteristics (tables: ref_colors, products, product_characteristics)
Question: What are the product ids and color descriptions for products with two or more 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
Database: products_gen_characteristics (tables: ref_colors, products)
Question: List all the product names with the color description "white".
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"
Database: products_gen_characteristics (tables: ref_colors, products)
Question: What are the names of products with 'white' as their color description?
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"
Database: products_gen_characteristics (tables: ref_colors, products)
Question: What are the name and typical buying and selling prices of the products that have color described as "yellow"?
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"
Database: products_gen_characteristics (tables: ref_colors, products)
Question: Return the names and typical buying and selling prices for products that have 'yellow' as their color description.
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"
Database: products_gen_characteristics (tables: products, product_characteristics)
Question: How many characteristics does the product named "sesame" have?
SQL: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id WHERE t1.product_name  =  "sesame"
Database: products_gen_characteristics (tables: products, product_characteristics)
Question: Count the number of characteristics the product 'sesame' has.
SQL: SELECT count(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id  =  t2.product_id WHERE t1.product_name  =  "sesame"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: How many distinct characteristic names does the product "cumin" have?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: Count the number of different characteristic names the product 'cumin' has.
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: What are all the characteristic names of product "sesame"?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: Return the characteristic names of the 'sesame' product.
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: List all the characteristic names and data types of product "cumin".
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: What are the names and data types of the characteristics of the 'cumin' product?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: List all characteristics of product named "sesame" with type code "Grade".
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: What are the names of the characteristics of the product 'sesame' that have the characteristic type code 'Grade'?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: How many characteristics does the product named "laurel" have?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: Count the number of characteristics of the product named 'laurel'.
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: Find the number of characteristics that the product "flax" has.
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: Count the number of characteristics of the 'flax' product.
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics, ref_colors)
Question: Find the name of the products that have the color description "red" and have the characteristic name "fast".
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics, ref_colors)
Question: What are the names of the products that have a color description of 'red' and the 'fast' characteristic?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: How many products have the characteristic named "hot"?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: Count the number of products with the 'hot' charactersitic.
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: List the all the distinct names of the products with the characteristic name 'warm'.
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: What are the different product names for products that have the 'warm' characteristic:?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics, ref_colors)
Question: Find the number of the products that have their color described as "red" and have a characteristic named "slow".
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics, ref_colors)
Question: How many products have the color description 'red' and the characteristic name 'slow'?
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics, ref_colors)
Question: Count the products that have the color description "white" or have the characteristic name "hot".
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"
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics, ref_colors)
Question: How many products have their color described as 'white' or have a characteristic with the name 'hot'?
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"
Database: products_gen_characteristics (tables: ref_product_categories)
Question: What is the unit of measuerment of the product category code "Herbs"?
SQL: SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code  =  "Herbs"
Database: products_gen_characteristics (tables: ref_product_categories)
Question: Return the unit of measure for 'Herb' products.
SQL: SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code  =  "Herbs"
Database: products_gen_characteristics (tables: ref_product_categories)
Question: Find the product category description of the product category with code "Spices".
SQL: SELECT product_category_description FROM ref_product_categories WHERE product_category_code  =  "Spices"
Database: products_gen_characteristics (tables: ref_product_categories)
Question: What is the description of the product category with the code 'Spices'?
SQL: SELECT product_category_description FROM ref_product_categories WHERE product_category_code  =  "Spices"
Database: products_gen_characteristics (tables: ref_product_categories)
Question: What is the product category description and unit of measurement of category "Herbs"?
SQL: SELECT product_category_description ,  unit_of_measure FROM ref_product_categories WHERE product_category_code  =  "Herbs"
Database: products_gen_characteristics (tables: ref_product_categories)
Question: Return the description and unit of measurement for products in the 'Herbs' category.
SQL: SELECT product_category_description ,  unit_of_measure FROM ref_product_categories WHERE product_category_code  =  "Herbs"
Database: products_gen_characteristics (tables: products, ref_product_categories)
Question: What is the unit of measurement of product named "cumin"?
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"
Database: products_gen_characteristics (tables: products, ref_product_categories)
Question: Give the unit of measure for the product with the name 'cumin'.
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"
Database: products_gen_characteristics (tables: products, ref_product_categories)
Question: Find the unit of measurement and product category code of product named "chervil".
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"
Database: products_gen_characteristics (tables: products, ref_product_categories)
Question: What are the unit of measure and category code for the 'chervil' product?
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"
Database: products_gen_characteristics (tables: ref_colors, products, ref_product_categories)
Question: Find the product names that are colored 'white' but do not have unit of measurement "Handful".
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"
Database: products_gen_characteristics (tables: ref_colors, products, ref_product_categories)
Question: What are the names of products that are not 'white' in color and are not measured by the unit 'Handful'?
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"
Database: products_gen_characteristics (tables: ref_colors, products)
Question: What is the description of the color for most products?
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
Database: products_gen_characteristics (tables: ref_colors, products)
Question: Return the color description that is most common across all products.
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
Database: products_gen_characteristics (tables: ref_colors, products)
Question: What is the description of the color used by least products?
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 LIMIT 1
Database: products_gen_characteristics (tables: ref_colors, products)
Question: Give the color description that is least common across products.
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 LIMIT 1
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: What is the characteristic name used by most number of the products?
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
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: Return the name of the characteristic that is most common across all products.
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
Database: products_gen_characteristics (tables: characteristics, product_characteristics)
Question: What are the names, details and data types of the characteristics which are never used by any product?
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
Database: products_gen_characteristics (tables: characteristics, product_characteristics)
Question: Give the names, details, and data types of characteristics that are not found in any product.
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
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: What are characteristic names used at least twice across all products?
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
Database: products_gen_characteristics (tables: characteristics, products, product_characteristics)
Question: Give the names of characteristics that are in two or more products?
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
Database: products_gen_characteristics (tables: ref_colors, products)
Question: How many colors are never used by any product?
SQL: SELECT count(*) FROM Ref_colors WHERE color_code NOT IN ( SELECT color_code FROM products )
Database: products_gen_characteristics (tables: ref_colors, products)
Question: Count the number of colors that are not used in any products.
SQL: SELECT count(*) FROM Ref_colors WHERE color_code NOT IN ( SELECT color_code FROM products )
Database: swimming (tables: event)
Question: How many events are there?
SQL: SELECT count(*) FROM event
Database: swimming (tables: event)
Question: List all the event names by year from the most recent to the oldest.
SQL: SELECT name FROM event ORDER BY YEAR DESC
Database: swimming (tables: event)
Question: What is the name of the event that happened in the most recent year?
SQL: SELECT name FROM event ORDER BY YEAR DESC LIMIT 1
Database: swimming (tables: stadium)
Question: How many stadiums are there?
SQL: SELECT count(*) FROM stadium
Database: swimming (tables: stadium)
Question: Find the name of the stadium that has the maximum capacity.
SQL: SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1
Database: swimming (tables: stadium)
Question: Find the names of stadiums whose capacity is smaller than the average capacity.
SQL: SELECT name FROM stadium WHERE capacity  <  (SELECT avg(capacity) FROM stadium)
Database: swimming (tables: stadium)
Question: Find the country that has the most stadiums.
SQL: SELECT country FROM stadium GROUP BY country ORDER BY count(*) DESC LIMIT 1
Database: swimming (tables: stadium)
Question: Which country has at most 3 stadiums listed?
SQL: SELECT country FROM stadium GROUP BY country HAVING count(*)  <=  3
Database: swimming (tables: stadium)
Question: Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?
SQL: SELECT country FROM stadium WHERE capacity  >  60000 INTERSECT SELECT country FROM stadium WHERE capacity  <  50000
Database: swimming (tables: stadium)
Question: How many cities have a stadium that was opened before the year of 2006?
SQL: SELECT count(DISTINCT city) FROM stadium WHERE opening_year  <  2006
Database: swimming (tables: stadium)
Question: How many stadiums does each country have?
SQL: SELECT country ,  count(*) FROM stadium GROUP BY country
Database: swimming (tables: stadium)
Question: Which countries do not have a stadium that was opened after 2006?
SQL: SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year  >  2006