select s2.store_id
,store_name
,product_category
,inventory_quantity
,sales_amount
from stores s1
/*用using简化代码,区别是using只会列出一列,on会列出两列*/
/*join sales_inventory s2 on s1.store_id = s2.store_id
join products p on s2.product_id = p.product_id*/
join sales_inventory s2 using(store_id)
join products p using(product_id)
where inventory_quantity < 10
and sales_amount > 5000.00
order by store_id
,s2.product_id