题解 | #题解#
统计2021年10月每个退货率不大于0.5的商品各项指标
https://www.nowcoder.com/practice/cbf582d28b794722becfc680847327be
select product_id ,ifnull(round(sum(if_click)/count(1),3),0) ctr -- 点展比 ,ifnull(round(sum(if_cart)/sum(if_click),3),0) cart_rate -- 加购率 ,ifnull(round(sum(if_payment)/sum(if_cart),3),0) payment_rate -- 成单率 ,ifnull(round(sum(if_refund)/sum(if_payment),3),0) refund_rate -- 退货率 from tb_user_event where date(event_time) like '2021-10%' group by 1 having refund_rate <= 0.5 order by 1;
