Easy And Simple || Oracle Sql
\n\n# Code\n\n/* Write your PL/SQL query statement below */\nSELECT p.product_id ,  NVL(ROUND(SUM(p.price * u.units) / NULLIF(SUM(u.units), 0), 2), 0) AS averag
\n\n# Code\n```\n/* Write your PL/SQL query statement below */\nSELECT p.product_id ,  NVL(ROUND(SUM(p.price * u.units) / NULLIF(SUM(u.units), 0), 2), 0) AS average_price\nFROM Prices p\nLEFT JOIN UnitsSold u\nON p.product_id = u.product_id AND u.purchase_date BETWEEN p.start_date AND p.end_date\nGROUP BY p.product_id;\n\n```
['Oracle']