human
Schema:
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)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the names of the products that have buying price < 100
assistant
SELECT product_name FROM products WHERE typical_buying_price < 100;
human
Show their distinct names.
assistant
SELECT DISTINCT product_name FROM products WHERE typical_buying_price < 100;
human
What about for those with color 'black'?
assistant
SELECT DISTINCT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "red" ;