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

某宝店铺动销率与售罄率

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

#  动销率(pin_rate,有销售的SKU数量/在售SKU数量)

    # 有销售的SKU数量,即为售出输数量

    # 在售sku数量,即总sku-售出数量

# 售罄率(sell-through_rate,GMV/备货值,备货值=吊牌价*库存数)

# GMV商品交易总额

with t1 as (

select style_id

    ,sum(tag_price*inventory) as through_rate

    ,sum(inventory) as SKU

from product_tb

group by style_id

)

,t2 as(

select style_id

    ,sum(sales_price) as GMV

    ,sum(sales_num) SKU_sale

from sales_tb

join product_tb using(item_id)

group by style_id

)

select style_id

    ,round(100*SKU_sale/(SKU-SKU_sale),2)

    ,round(100*GMV/through_rate,2)

from t1

join t2 using(style_id)

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务