SQL 코드카타
문제 링크
SELECT user_id, Sum(s.quantity * p.price) AS "spending" FROM sales s LEFT JOIN product p ON s.product_id = p.product_id GROUP BY 1 ORDER BY 2 DESC, 1;