my answer to ''The numerator should count the distinct order_ids. The denominator should count the distinct values of the orders table's delivered_to field (orders.delivered_to)." is:
select name, round(1.0 * count(distinct order_id) /
count(distinct delivered_to), 2) as reorder_rate
join orders on
orders.id = order_items.order_id
group by 1
order by 2 desc
anyone could shed some light for me, please?