select round((sum(sa.sales_price)/(sum(sa.sales_num*pt.tag_price)))*100,2) as discount_rate
from product_tb as pt
right join sales_tb as sa 
on pt.item_id=sa.item_id