- 각 상품별 평균 가격을 출력하라.
=>소수점2자리까지 출력
SELECT p.product_id, IFNULL(round(SUM(p.price*u.units)/sum(u.units),2),0) as average_price
FROM Prices p
LEFT JOIN UnitsSold u
ON p.product_id = u.product_id AND
u.purchase_date BETWEEN p.Start_date and p.end_date
GROUP BY p.product_id