Yes. I just want to know the names of which customers have placed orders under the category "food"
select t1.customer_name from customers as t1 join orders as t2 join order_items as t3 join products as t4 on t1.customer_id = t2.customer_id and t2.order_id = t3.order_id and t3.product_id = t4.product_id where t4.product_name = "food"
Of the names listed in the table, which of them have an item status listed as "cancel"?
select t1.customer_name from customers as t1 join orders as t2 join order_items as t3 join products as t4 on t1.customer_id = t2.customer_id and t2.order_id = t3.order_id and t3.product_id = t4.product_id where t3.order_item_status = "Cancel" and t4.product_name = "food" group by t1.customer_id having count ( * ) > = 1
yes
select count ( t1.customer_name ) from customers as t1 join orders as t2 join order_items as t3 join products as t4 on t1.customer_id = t2.customer_id and t2.order_id = t3.order_id and t3.product_id = t4.product_id where t3.order_item_status = "Cancel" and t4.product_name = "food"