select
city,
sum(total_amount) as total_order_amount
from orders
join customers using(customer_id)
group by city
order by total_order_amount desc,city;

select
city,
sum(total_amount) as total_order_amount
from orders
join customers using(customer_id)
group by city
order by total_order_amount desc,city;