EASY UNDERSTANDIBLE SOLUTION
Code\n\nselect p.product_id,round(sum(p.price*u.units)/sum(u.units),2) as average_price \nfrom Prices p \nleft join \nUnitsSold u \non p.product_id=u.product_id
# Code\n```\nselect p.product_id,round(sum(p.price*u.units)/sum(u.units),2) as average_price \nfrom Prices p \nleft join \nUnitsSold u \non p.product_id=u.product_id \nwhere u.purchase_date>=p.start_date and u.purchase_date<=p.end_date \ngroup by p.product_id\n```PLEASE UPVOTE TO MOTIVATE ME WRITE MORE SOLUTION2
['MySQL']