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