select 
    sa.store_id,
    store_name,
    product_category,
    inventory_quantity,
    sales_amount
from sales_inventory sa 
join stores st on st.store_id=sa.store_id
join products p on sa.product_id=p.product_id
where inventory_quantity<10 and sales_amount>5000
order by 1,sa.product_id;