Simple SQL Solution | #javith_sadham_hussain
Code\n\nSelect \n    p.product_id,\n    round(sum(u.units * p.price) / sum(u.units) , 2) as average_price \nfrom Prices p\njoin UnitsSold u\non (p.product_id = 
# Code\n```\nSelect \n    p.product_id,\n    round(sum(u.units * p.price) / sum(u.units) , 2) as average_price \nfrom Prices p\njoin UnitsSold u\non (p.product_id = u.product_id and\n    u.purchase_date between p.start_date and p.end_date)\ngroup by product_id;\n \n```
['MySQL']