题解 | #从 Products 表中检索所有的产品名称以及对应的销售总数#
从 Products 表中检索所有的产品名称以及对应的销售总数
http://www.nowcoder.com/practice/2b289b78de1546f38fd24e17e56f1bec
SELECT prod_name, SUM(quantity) AS quant_sold
FROM Products p
JOIN OrderItems o ON p.prod_id = o.prod_id
GROUP BY prod_name;