Modify the SQL statement created in the previous challenge so that it returns a total of number of orders for each item (as opposed to the order numbers).


SELECT prod_name, COUNT(order_num) AS orders
FROM Products LEFT OUTER JOIN OrderItems
 ON Products.prod_id = OrderItems.prod_id
GROUP BY prod_name
ORDER BY prod_name;

Comment on this FAQ