Show the names of products that have buying price > 100
select product_name from products where typical_buying_price > 100
How many are there?
select count(*) from products where typical_buying_price > 100
What about for those with color description "red"?
select count(*) from products as t1 join ref_colors as t2 on t1.color_code = t2.color_code where t2.color_description = "red"
Show the ones with color description "white" instead.
select count(*) from products as t1 join ref_colors as t2 on t1.color_code = t2.color_code where t2.color_description = "white"
They can also be having the characteristic name "hot".
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"