select cust_id,sum(quantity*item_price) as total_ordered from OrderItems as a left join Orders as b on a.order_num=b.order_num where b.cust_id is not null group by cust_id order by total_ordered ...