# Write your MySQL query statement belowselect p.product_id,round(sum(p.price * u.units)/sum(u.units),2) average_price from Prices p
innerjoin UnitsSold u where p.product_id = u.product_id
and u.purchase_date between p.start_date and end_date groupby p.product_id;