✅ 100% EASY || FAST 🔥|| CLEAN  SOLUTION 🌟
IF THIS WILL BE HELPFUL TO YOU, PLEASE UPVOTE !\n\n# Code\n\n/* Write your PL/SQL query statement below */\nSELECT P.product_id, ROUND(SUM(U.units * P.price) / 
IF THIS WILL BE HELPFUL TO YOU, PLEASE UPVOTE !\n\n# Code\n```\n/* Write your PL/SQL query statement below */\nSELECT P.product_id, ROUND(SUM(U.units * P.price) / SUM(U.units),2) \n\nAS average_price FROM Prices P INNER JOIN UnitsSold U ON \n\nP.product_id = U.product_id AND U.purchase_date BETWEEN \n\nP.start_date AND P.end_date  GROUP BY P.product_id\n\n```\n![5kej8w.jpg](https://assets.leetcode.com/users/images/9d0926d6-8fb9-4cb1-8255-945e02bfe475_1691159221.1510832.jpeg)
['Database', 'Oracle']