select name, count(DISTINCT order_id)
from order_items
group by 1
order by 1;
-- number of people making the orders
select name, round(1.0 * count(DISTINCT order_id) /
count(DISTINCT delivered_to), 2) as reorder_rate
from order_items
join orders on
orders.id = order_items.order_id
group by 1
order by 2 desc;
No comments:
Post a Comment