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

某宝店铺动销率与售罄率

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

SELECT
style_id,
ROUND(SUM(i_sales_num_total)/(SUM(i_inventory_total) - SUM(i_sales_num_total)) * 100, 2) AS 'pin_rate(%)',
ROUND(SUM(i_sales_price_total)/SUM(i_tag_price) * 100, 2) AS 'sell-through_rate(%)'

FROM(
SELECT
style_id,
item_id,
SUM(sales_num) AS i_sales_num_total,
SUM(DISTINCT inventory) AS i_inventory_total,
SUM(sales_price) AS i_sales_price_total,
SUM(DISTINCT tag_price * inventory) AS i_tag_price

FROM product_tb
JOIN sales_tb
    USING(item_id)

WHERE LEFT(sales_date, 7) = '2021-11'

GROUP BY style_id, item_id) AS t1

GROUP BY style_id

全部评论

相关推荐

找不到工作死了算了:没事的,雨英,hr肯主动告知结果已经超越大部分hr了
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务