题解 | 电商平台需要对商家的销售业绩、退款情况和客户满意度进行综合评估
电商平台需要对商家的销售业绩、退款情况和客户满意度进行综合评估
https://www.nowcoder.com/practice/48a236567617449eb6010274b30b29e8
select merchant_id,merchant_name, round(sum(sale_amount)/2,2) as total_sales_amount, round(sum(refund_amount)/4,2) as total_refund_amount, round(avg(satisfaction_score),2) as average_satisfaction_score from merchants_underline m join sales_underline s using(merchant_id) join refunds_underline r using(merchant_id) join satisfaction_underline using(merchant_id) group by merchant_id,merchant_name order by merchant_id
钻空子