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