select style_id as 商店名称,
	   round((sum(总销售件数)/sum(inventory - 总销售件数))*100,2) as 动销率,
	   round((sum(总收入)/sum(tag_price*inventory))*100,2) as 售罄率
       from
       product_tb join
(select item_id,sum(sales_num) as 总销售件数,sum(sales_price) as 总收入
       from
       sales_tb
       group by item_id) a
       on product_tb.item_id = a.item_id
       group by style_id
       order by style_id;