与97题差不多,加入了条件筛选,减少了一个分组

select cust_name,sum(quantity*item_price) as total_price
from Customers t inner join Orders t1 on t.cust_id = t1.cust_id
inner join OrderItems  t2 on t1.order_num = t2.order_num
group by cust_name having total_price >=1000
order by cust_name

综合测试