题解 | 分析不同门店各类商品的库存情况和销售情况
分析不同门店各类商品的库存情况和销售情况
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
真是一道憨包题目,出题人是中专生吧,实际会有这种需求嘛

