SQL104 返回产品名称和每一项产品的总订单数
運行SQL代碼:
select prod_name, count(order_num) orders
from Products a
left JOIN OrderItems b using(prod_id)
group by prod_name
order by prod_name
SQL105 列出供应商及其可供产品的数量
運行SQL代碼:
select prod_name, count(order_num) orders
from Products a
left JOIN OrderItems b using(prod_id)
group by prod_name
order by prod_name