题解 | #某宝店铺动销率与售罄率#

某宝店铺动销率与售罄率

http://www.nowcoder.com/practice/715dd44c994f45cb871afa98f1b77538

  • 这道题其实思想很简单,就是计算动销率和售罄率的公式理解了我好半天,题解排名第一的朋友讲解的很棒,有需要可以去看看!其他的就不多说啦!做法很常规
with t as(select 
	style_id,
    tag_price,
    inventory,
    sales_num,
    sales_price
from product_tb pt
left join sales_tb st
using(item_id))

select 
	style_id,
round((sum(sales_num)/(sum(distinct inventory)-sum(sales_num)))*100,2) as 'pin_rate(%)',
	round((sum(sales_price)/sum(distinct tag_price*inventory))*100 ,2)as 'sell-through_rate(%)'
from t
group by style_id
order by style_id
全部评论

相关推荐

数开小菜鸡:你是我今早见过的最美的牛客女孩......
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务