题解 | 查询出每个品牌在特定时间段内的退货率以及平均客户满意度评分
查询出每个品牌在特定时间段内的退货率以及平均客户满意度评分
https://www.nowcoder.com/practice/39f4ccb8ac1b47a89d092b4d8ed08bc8
select
s.brand_id,
b.brand_name,
round(sum(s.return_status) / count(s.order_id),2) as return_rate_July_2024,
round(avg(c.customer_satisfaction_score),2) as average_customer_satisfaction_score
from
sales_orders s
left join
brand_info b on s.brand_id = b.brand_id
left join
customer_feedback c on s.order_id = c.order_id
where
date_format(s.order_date,'%Y-%m') = '2024-07'
group by
1,2
order by
1
拼多多集团-PDD成长空间 997人发布
