Simply MySQL Solution using BETWEEN, SUM, and WHERE
\nSELECT product_id, IFNULL(ROUND(SUM(price*units)/SUM(units),2),0) AS average_price\nFROM Prices\nJOIN UnitsSold\nUSING(product_id)\nWHERE purchase_date BETWEE
```\nSELECT product_id, IFNULL(ROUND(SUM(price*units)/SUM(units),2),0) AS average_price\nFROM Prices\nJOIN UnitsSold\nUSING(product_id)\nWHERE purchase_date BETWEEN start_date AND end_date\nGROUP BY product_id\nORDER BY product_id\n\n\n```\n
[]