SELECT
    c.city,
    SUM(o.total_amount) AS total_order_amount
FROM
    orders AS o
    INNER JOIN
    customers AS c ON o.customer_id=c.customer_id
GROUP BY
    c.city
ORDER BY
    total_order_amount DESC,
    c.city ASC;