Search is not available for this dataset
db_id
stringlengths
3
31
query
stringlengths
20
523
question
stringlengths
3
224
schema
stringlengths
589
322M
query_res
stringlengths
0
363k
products_gen_characteristics
SELECT product_name , typical_buying_price FROM products
Return the names and typical buying prices for all products.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('cumin', '') ('peper', '352447.2874677') ('basil', '503.8431967') ('borage', '') ('chili', '') ('ginger', '5.578') ('sesame', '1284268.0659') ('caraway', '24493') ('catnip', '12008702.623') ('flax', '339404395.7') ('chervil', '') ('voluptatem', '162') ('cinnam', '1686539.4') ('lotus', '43221310.465574') ('laurel', '')...
products_gen_characteristics
SELECT color_description FROM ref_colors
List the description of all the colors.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('red',) ('green',) ('yellow',) ('blue',) ('black',) ('white',) ('purple',) ('gray',)
products_gen_characteristics
SELECT color_description FROM ref_colors
What are the descriptions for each color?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('red',) ('green',) ('yellow',) ('blue',) ('black',) ('white',) ('purple',) ('gray',)
products_gen_characteristics
SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
Find the names of all the product characteristics.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('slow',) ('fast',) ('warm',) ('hot',) ('cool',) ('error',)
products_gen_characteristics
SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
What are the different names of the product characteristics?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('slow',) ('fast',) ('warm',) ('hot',) ('cool',) ('error',)
products_gen_characteristics
SELECT product_name FROM products WHERE product_category_code = "Spices"
What are the names of products with category "Spices"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('cumin',) ('peper',) ('chili',) ('cinnam',)
products_gen_characteristics
SELECT product_name FROM products WHERE product_category_code = "Spices"
Return the names of products in the category 'Spices'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('cumin',) ('peper',) ('chili',) ('cinnam',)
products_gen_characteristics
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"
List the names, color descriptions and product descriptions of products with category "Herbs".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('basil', 'red', 'officia') ('borage', 'yellow', 'blanditiis') ('caraway', 'red', 'nulla') ('catnip', 'white', 'vel') ('chervil', 'black', 'minus') ('laurel', 'white', 'ut')
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('basil', 'red', 'officia') ('borage', 'yellow', 'blanditiis') ('caraway', 'red', 'nulla') ('catnip', 'white', 'vel') ('chervil', 'black', 'minus') ('laurel', 'white', 'ut')
products_gen_characteristics
SELECT count(*) FROM products WHERE product_category_code = "Seeds"
How many products are there under the category "Seeds"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(5,)
products_gen_characteristics
SELECT count(*) FROM products WHERE product_category_code = "Seeds"
Count the number of products in the category 'Seeds'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(5,)
products_gen_characteristics
SELECT count(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000
Find the number of products with category "Spices" and typically sold above 1000.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(2,)
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(2,)
products_gen_characteristics
SELECT product_category_code , typical_buying_price FROM products WHERE product_name = "cumin"
What is the category and typical buying price of the product with name "cumin"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Spices', '')
products_gen_characteristics
SELECT product_category_code , typical_buying_price FROM products WHERE product_name = "cumin"
Return the category code and typical price of 'cumin'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Spices', '')
products_gen_characteristics
SELECT product_category_code FROM products WHERE product_name = "flax"
Which category does the product named "flax" belong to?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Seeds',)
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Seeds',)
products_gen_characteristics
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'
What is the name of the product with the color description 'yellow'?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('borage',)
products_gen_characteristics
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'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('borage',)
products_gen_characteristics
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%'
Find the category descriptions of the products whose descriptions include letter 't'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Spices',) ('Herbs',) ('Seeds',) ('Seeds',) ('Seeds',) ('Herbs',)
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Spices',) ('Herbs',) ('Seeds',) ('Seeds',) ('Seeds',) ('Herbs',)
products_gen_characteristics
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 description of the product with name "catnip"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('white',)
products_gen_characteristics
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'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('white',)
products_gen_characteristics
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"
What is the color code and description of the product named "chervil"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('7', 'black')
products_gen_characteristics
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'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('7', 'black')
products_gen_characteristics
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
Find the id and color description of the products with at least 2 characteristics.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(6, 'blue') (7, 'red') (11, 'black') (12, 'blue')
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(6, 'blue') (7, 'red') (11, 'black') (12, 'blue')
products_gen_characteristics
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"
List all the product names with the color description "white".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('peper',) ('catnip',) ('laurel',)
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('peper',) ('catnip',) ('laurel',)
products_gen_characteristics
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"
What are the name and typical buying and selling prices of the products that have color described as "yellow"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('borage', '', '10377614.847385')
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('borage', '', '10377614.847385')
products_gen_characteristics
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 characteristics does the product named "sesame" have?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(2,)
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(2,)
products_gen_characteristics
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"
How many distinct characteristic names does the product "cumin" have?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(2,)
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(2,)
products_gen_characteristics
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"
What are all the characteristic names of product "sesame"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('error',) ('fast',)
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('error',) ('fast',)
products_gen_characteristics
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 the characteristic names and data types of product "cumin".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('slow', 'mollitia')
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('slow', 'mollitia')
products_gen_characteristics
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"
List all characteristics of product named "sesame" with type code "Grade".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('error',) ('fast',)
products_gen_characteristics
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'?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('error',) ('fast',)
products_gen_characteristics
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"
How many characteristics does the product named "laurel" have?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(0,)
products_gen_characteristics
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'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(0,)
products_gen_characteristics
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 number of characteristics that the product "flax" has.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(0,)
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(0,)
products_gen_characteristics
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"
Find the name of the products that have the color description "red" and have the characteristic name "fast".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('sesame',) ('caraway',)
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('sesame',) ('caraway',)
products_gen_characteristics
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"
How many products have the characteristic named "hot"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(1,)
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(1,)
products_gen_characteristics
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"
List the all the distinct names of the products with the characteristic name 'warm'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('chervil',)
products_gen_characteristics
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:?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('chervil',)
products_gen_characteristics
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"
Find the number of the products that have their color described as "red" and have a characteristic named "slow".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(0,)
products_gen_characteristics
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'?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(0,)
products_gen_characteristics
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"
Count the products that have the color description "white" or have the characteristic name "hot".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(1,)
products_gen_characteristics
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'?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(1,)
products_gen_characteristics
SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
What is the unit of measuerment of the product category code "Herbs"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Handful ',)
products_gen_characteristics
SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
Return the unit of measure for 'Herb' products.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Handful ',)
products_gen_characteristics
SELECT product_category_description FROM ref_product_categories WHERE product_category_code = "Spices"
Find the product category description of the product category with code "Spices".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Spices',)
products_gen_characteristics
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'?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Spices',)
products_gen_characteristics
SELECT product_category_description , unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
What is the product category description and unit of measurement of category "Herbs"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Herbs', 'Handful ')
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Herbs', 'Handful ')
products_gen_characteristics
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"
What is the unit of measurement of product named "cumin"?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Weight - pound,kilo.',)
products_gen_characteristics
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'.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Weight - pound,kilo.',)
products_gen_characteristics
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 unit of measurement and product category code of product named "chervil".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Handful ', 'Herbs')
products_gen_characteristics
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?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('Handful ', 'Herbs')
products_gen_characteristics
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"
Find the product names that are colored 'white' but do not have unit of measurement "Handful".
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('peper',) ('catnip',) ('laurel',)
products_gen_characteristics
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'?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('peper',) ('catnip',) ('laurel',)
products_gen_characteristics
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 for most products?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('blue',)
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('blue',)
products_gen_characteristics
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
What is the description of the color used by least products?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('black',)
products_gen_characteristics
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
Give the color description that is least common across products.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('black',)
products_gen_characteristics
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 is the characteristic name used by most number of the products?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('fast',)
products_gen_characteristics
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.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('fast',)
products_gen_characteristics
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_i...
What are the names, details and data types of the characteristics which are never used by any product?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('cool', None, 'dolores') ('cool', None, 'et') ('cool', None, 'quam') ('hot', None, 'impedit') ('slow', None, 'numquam') ('slow', None, 'placeat')
products_gen_characteristics
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_i...
Give the names, details, and data types of characteristics that are not found in any product.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('cool', None, 'dolores') ('cool', None, 'et') ('cool', None, 'quam') ('hot', None, 'impedit') ('slow', None, 'numquam') ('slow', None, 'placeat')
products_gen_characteristics
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
What are characteristic names used at least twice across all products?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('fast',) ('slow',) ('warm',)
products_gen_characteristics
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
Give the names of characteristics that are in two or more products?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
('fast',) ('slow',) ('warm',)
products_gen_characteristics
SELECT count(*) FROM Ref_colors WHERE color_code NOT IN ( SELECT color_code FROM products )
How many colors are never used by any product?
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(2,)
products_gen_characteristics
SELECT count(*) FROM Ref_colors WHERE color_code NOT IN ( SELECT color_code FROM products )
Count the number of colors that are not used in any products.
PRAGMA foreign_keys = ON; CREATE TABLE `Ref_Characteristic_Types` ( `characteristic_type_code` VARCHAR(15) PRIMARY KEY, `characteristic_type_description` VARCHAR(80) ); CREATE TABLE `Ref_Colors` ( `color_code` VARCHAR(15) PRIMARY KEY, `color_description` VARCHAR(80) ); CREATE TABLE `Ref_Product_Categories` ( `product_c...
(2,)
swimming
SELECT count(*) FROM event
How many events are there?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
(6,)
swimming
SELECT name FROM event ORDER BY YEAR DESC
List all the event names by year from the most recent to the oldest.
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('European FINA',) ('FINA',) ('IPC',) ('World Junior',) ('World Master',) ('Pacific',)
swimming
SELECT name FROM event ORDER BY YEAR DESC LIMIT 1
What is the name of the event that happened in the most recent year?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('European FINA',)
swimming
SELECT count(*) FROM stadium
How many stadiums are there?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
(10,)
swimming
SELECT name FROM stadium ORDER BY capacity DESC LIMIT 1
Find the name of the stadium that has the maximum capacity.
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Nou Mestalla',)
swimming
SELECT name FROM stadium WHERE capacity < (SELECT avg(capacity) FROM stadium)
Find the names of stadiums whose capacity is smaller than the average capacity.
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Northumberland Development Project',) ('Fisht Olympic Stadium',) ('Arena Baltika',) ('Yubileyniy Stadium',)
swimming
SELECT country FROM stadium GROUP BY country ORDER BY count(*) DESC LIMIT 1
Find the country that has the most stadiums.
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Russia',)
swimming
SELECT country FROM stadium GROUP BY country HAVING count(*) <= 3
Which country has at most 3 stadiums listed?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Azerbaijan',) ('England',) ('France',) ('Hungary',) ('Spain',)
swimming
SELECT country FROM stadium WHERE capacity > 60000 INTERSECT SELECT country FROM stadium WHERE capacity < 50000
Which country has both stadiums with capacity greater than 60000 and stadiums with capacity less than 50000?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Russia',)
swimming
SELECT count(DISTINCT city) FROM stadium WHERE opening_year < 2006
How many cities have a stadium that was opened before the year of 2006?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
(7,)
swimming
SELECT country , count(*) FROM stadium GROUP BY country
How many stadiums does each country have?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Azerbaijan', 1) ('England', 1) ('France', 1) ('Hungary', 1) ('Russia', 4) ('Spain', 2)
swimming
SELECT country FROM stadium EXCEPT SELECT country FROM stadium WHERE opening_year > 2006
Which countries do not have a stadium that was opened after 2006?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Azerbaijan',) ('England',) ('France',) ('Hungary',) ('Spain',)
swimming
SELECT count(*) FROM stadium WHERE country != 'Russia'
How many stadiums are not in country "Russia"?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
(6,)
swimming
SELECT name FROM swimmer ORDER BY meter_100
Find the names of all swimmers, sorted by their 100 meter scores in ascending order.
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Sébastien Rouault',) ('Przemysław Stańczyk',) ('Oussama Mellouli',) ('Sergiy Fesenko',) ('Grant Hackett',) ('Craig Stevens',) ('Federico Colbertaldo',) ('Ryan Cochrane',)
swimming
SELECT count(DISTINCT nationality) FROM swimmer
How many different countries are all the swimmers from?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
(7,)
swimming
SELECT nationality , count(*) FROM swimmer GROUP BY nationality HAVING count(*) > 1
List countries that have more than one swimmer.
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Australia', 2)
swimming
SELECT meter_200 , meter_300 FROM swimmer WHERE nationality = 'Australia'
Find all 200 meter and 300 meter results of swimmers with nationality "Australia".
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('1:56.34', '2:55.90') ('1:57.21', '2:56.95')
swimming
SELECT t1.name FROM swimmer AS t1 JOIN record AS t2 ON t1.id = t2.swimmer_id WHERE RESULT = 'Win'
Find the names of swimmers who has a result of "win".
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Sergiy Fesenko',) ('Craig Stevens',) ('Ryan Cochrane',) ('Federico Colbertaldo',) ('Grant Hackett',) ('Oussama Mellouli',) ('Craig Stevens',) ('Craig Stevens',) ('Oussama Mellouli',)
swimming
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
What is the name of the stadium which held the most events?
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Yubileyniy Stadium',)
swimming
SELECT t1.name , t1.capacity FROM stadium AS t1 JOIN event AS t2 ON t1.id = t2.stadium_id WHERE t2.name = 'World Junior'
Find the name and capacity of the stadium where the event named "World Junior" happened.
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Baku Olympic Stadium', 68000)
swimming
SELECT name FROM stadium WHERE id NOT IN (SELECT stadium_id FROM event)
Find the names of stadiums which have never had any event.
PRAGMA foreign_keys = ON; CREATE TABLE "swimmer" ( "ID" int, "name" text, "Nationality" text, "meter_100" real, "meter_200" text, "meter_300" text, "meter_400" text, "meter_500" text, "meter_600" text, "meter_700" text, "Time" text, PRIMARY KEY ("ID") ); INSERT INTO "swimmer" VALUES ("7","Przemysław Stańczyk","Po...
('Ferenc Puskás Stadion',) ('Stade des Lumières',) ('Northumberland Development Project',) ('Arena Baltika',)