How many distinct order ids correspond to each product?
SELECT product_id ,  count(DISTINCT order_id) FROM Order_items GROUP BY product_id
distinct order ids correspond to each product refers to COUNT(DISTINCT order_id) GROUPED BY product_id;