select
c.city,
sum(o.total_amount) as total_order_amount
from orders o left join customers c
on o.customer_id=c.customer_id
group by c.city
order by total_order_amount desc,c.city asc