题解 | 分析不同门店各类商品的库存情况和销售情况

分析不同门店各类商品的库存情况和销售情况

https://www.nowcoder.com/practice/5b9262a36724466ea1ae1f58187197d6

# 库存数量小于10,销售额超过5000
with
t1 as(
    select
        store_id,
        product_id,
        inventory_quantity,
        sales_amount
    from
        sales_inventory
    where
        inventory_quantity<10 and sales_amount>5000
)
,
t2 as(
    select
        store_id,
        store_name,
        product_category,
        inventory_quantity,
        sales_amount
    from
        t1
        left join products using(product_id)
        left join stores using(store_id)
    order by
        store_id,
        product_id
)

select * from t2

全部评论

相关推荐

02-26 09:15
已编辑
蚌埠学院 golang
点赞 评论 收藏
分享
03-08 18:11
门头沟学院 Java
想要实习的牛:这么牛逼的简历都吃瘪吗🌚那我不寄了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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