# 查询任意订单中三种以上订单产品总价超过15 的用户
SELECT c.cust_name FROM customers c
LEFT JOIN orders o ON c.cust_id = o.cust_id
LEFT JOIN orderitems oi ON oi.order_num = o.order_num AND oi.item_price >15
GROUP BY oi.order_num HAVING COUNT(oi.prod_id) >=3
SELECT c.cust_name FROM customers c
LEFT JOIN orders o ON c.cust_id = o.cust_id
LEFT JOIN orderitems oi ON oi.order_num = o.order_num AND oi.item_price >15
GROUP BY oi.order_num HAVING COUNT(oi.prod_id) >=3