db_name
stringclasses 146
values | prompt
stringlengths 310
4.81k
|
|---|---|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# For each advisor, report the total number of students advised by him or her.
#
### SQL:
#
# SELECT Advisor , count(*) FROM STUDENT GROUP BY Advisor
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# How many students does each advisor have?
#
### SQL:
#
# SELECT Advisor , count(*) FROM STUDENT GROUP BY Advisor
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Report all advisors that advise more than 2 students.
#
### SQL:
#
# SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Which advisors have more than two students?
#
### SQL:
#
# SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING COUNT(*) > 2
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Report all majors that have less than 3 students.
#
### SQL:
#
# SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# What are the majors only less than three students are studying?
#
### SQL:
#
# SELECT Major FROM STUDENT GROUP BY Major HAVING COUNT(*) < 3
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# For each election cycle, report the number of voting records.
#
### SQL:
#
# SELECT Election_Cycle , count(*) FROM VOTING_RECORD GROUP BY Election_Cycle
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Count the number of voting records for each election cycle.
#
### SQL:
#
# SELECT Election_Cycle , count(*) FROM VOTING_RECORD GROUP BY Election_Cycle
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Which major has the most students?
#
### SQL:
#
# SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Find the major that is studied by the largest number of students.
#
### SQL:
#
# SELECT Major FROM STUDENT GROUP BY major ORDER BY count(*) DESC LIMIT 1
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# What is the most common major among female (sex is F) students?
#
### SQL:
#
# SELECT Major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY count(*) DESC LIMIT 1
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Find the major that is studied by the most female students.
#
### SQL:
#
# SELECT Major FROM STUDENT WHERE Sex = "F" GROUP BY major ORDER BY count(*) DESC LIMIT 1
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# What is the city_code of the city that the most students live in?
#
### SQL:
#
# SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY count(*) DESC LIMIT 1
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Return the code of the city that has the most students.
#
### SQL:
#
# SELECT city_code FROM STUDENT GROUP BY city_code ORDER BY count(*) DESC LIMIT 1
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Report the distinct advisors who have more than 2 students.
#
### SQL:
#
# SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING count(*) > 2
#
### End.
|
voter_2
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Student ( StuID, LName, Fname, Age, Sex, Major, Advisor, city_code )
# Voting_record ( StuID, Registration_Date, Election_Cycle, President_Vote, Vice_President_Vote, Secretary_Vote, Treasurer_Vote, Class_President_Vote, Class_Senator_Vote )
#
# Voting_record.Class_Senator_Vote can be joined with Student.StuID
# Voting_record.Class_President_Vote can be joined with Student.StuID
# Voting_record.Treasurer_Vote can be joined with Student.StuID
# Voting_record.Secretary_Vote can be joined with Student.StuID
# Voting_record.Vice_President_Vote can be joined with Student.StuID
# Voting_record.President_Vote can be joined with Student.StuID
# Voting_record.StuID can be joined with Student.StuID
#
### Question:
#
# Which advisors are advising more than 2 students?
#
### SQL:
#
# SELECT Advisor FROM STUDENT GROUP BY Advisor HAVING count(*) > 2
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# How many products are there?
#
### SQL:
#
# SELECT count(*) FROM products
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Count the number of products.
#
### SQL:
#
# SELECT count(*) FROM products
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# How many colors are there?
#
### SQL:
#
# SELECT count(*) FROM ref_colors
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Count the number of colors.
#
### SQL:
#
# SELECT count(*) FROM ref_colors
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# How many characteristics are there?
#
### SQL:
#
# SELECT count(*) FROM CHARACTERISTICS
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Count the number of characteristics.
#
### SQL:
#
# SELECT count(*) FROM CHARACTERISTICS
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What are the names and buying prices of all the products?
#
### SQL:
#
# SELECT product_name , typical_buying_price FROM products
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Return the names and typical buying prices for all products.
#
### SQL:
#
# SELECT product_name , typical_buying_price FROM products
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# List the description of all the colors.
#
### SQL:
#
# SELECT color_description FROM ref_colors
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What are the descriptions for each color?
#
### SQL:
#
# SELECT color_description FROM ref_colors
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Find the names of all the product characteristics.
#
### SQL:
#
# SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What are the different names of the product characteristics?
#
### SQL:
#
# SELECT DISTINCT characteristic_name FROM CHARACTERISTICS
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What are the names of products with category "Spices"?
#
### SQL:
#
# SELECT product_name FROM products WHERE product_category_code = "Spices"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Return the names of products in the category 'Spices'.
#
### SQL:
#
# SELECT product_name FROM products WHERE product_category_code = "Spices"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# List the names, color descriptions and product descriptions of products with category "Herbs".
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What are the names, color descriptions, and product descriptions for products in the 'Herbs' category?
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# How many products are there under the category "Seeds"?
#
### SQL:
#
# SELECT count(*) FROM products WHERE product_category_code = "Seeds"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Count the number of products in the category 'Seeds'.
#
### SQL:
#
# SELECT count(*) FROM products WHERE product_category_code = "Seeds"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Find the number of products with category "Spices" and typically sold above 1000.
#
### SQL:
#
# SELECT count(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# How many products are in the 'Spices' category and have a typical price of over 1000?
#
### SQL:
#
# SELECT count(*) FROM products WHERE product_category_code = "Spices" AND typical_buying_price > 1000
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What is the category and typical buying price of the product with name "cumin"?
#
### SQL:
#
# SELECT product_category_code , typical_buying_price FROM products WHERE product_name = "cumin"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Return the category code and typical price of 'cumin'.
#
### SQL:
#
# SELECT product_category_code , typical_buying_price FROM products WHERE product_name = "cumin"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Which category does the product named "flax" belong to?
#
### SQL:
#
# SELECT product_category_code FROM products WHERE product_name = "flax"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What is the code of the category that the product with the name 'flax' belongs to?
#
### SQL:
#
# SELECT product_category_code FROM products WHERE product_name = "flax"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What is the name of the product with the color description 'yellow'?
#
### 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'
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Give the name of the products that have a color description 'yellow'.
#
### 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'
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Find the category descriptions of the products whose descriptions include letter 't'.
#
### 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%'
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What are the descriptions of the categories that products with product descriptions that contain the letter t are in?
#
### 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%'
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# What is the color description of the product with name "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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### Question:
#
# Return the unit of measure for 'Herb' products.
#
### SQL:
#
# SELECT unit_of_measure FROM ref_product_categories WHERE product_category_code = "Herbs"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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"
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
products_gen_characteristics
|
### Complete SQL query only and with no explanation
### SQL tables followed by foreign key information:
#
# Ref_Characteristic_Types ( characteristic_type_code, characteristic_type_description )
# Ref_Colors ( color_code, color_description )
# Ref_Product_Categories ( product_category_code, product_category_description, unit_of_measure )
# Characteristics ( characteristic_id, characteristic_type_code, characteristic_data_type, characteristic_name, other_characteristic_details )
# Products ( product_id, color_code, product_category_code, product_name, typical_buying_price, typical_selling_price, product_description, other_product_details )
# Product_Characteristics ( product_id, characteristic_id, product_characteristic_value )
#
# Characteristics.characteristic_type_code can be joined with Ref_Characteristic_Types.characteristic_type_code
# Products.color_code can be joined with Ref_Colors.color_code
# Products.product_category_code can be joined with Ref_Product_Categories.product_category_code
# Product_Characteristics.product_id can be joined with Products.product_id
# Product_Characteristics.characteristic_id can be joined with Characteristics.characteristic_id
#
### 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
#
### End.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.