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

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

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

select
    store_id,
    store_name,
    product_category,
    sum(inventory_quantity) inventory_quantity,
    sum(sales_amount) sales_amount
from
sales_inventory s1
left join
products s2
using(product_id)
left join
stores s3
using(store_id)
group by 1,2,product_id,3
having sum(inventory_quantity)<10 and sum(sales_amount)>5000
order by 1, product_id

真是一道憨包题目,出题人是中专生吧,实际会有这种需求嘛

全部评论

相关推荐

点赞 评论 收藏
分享
09-16 14:01
井冈山大学 Java
肖先生~:兄弟们,我发的她都点赞了,但是就是不给我微信
秋招被确诊为……
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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