Daily LeetCode #7
Some notes on problems from SQL 50. https://leetcode.com/problems/average-selling-price/submissions/1424623318/?envType=study-plan-v2&envId=top-sql-50 SELECT P.product_id, IFNULL(round(sum(P.price * U.units) / sum(U.units), 2), 0) AS average_price FROM Prices AS P LEFT OUTER JOIN UnitsSold AS U ON P.