Given a table Orders(City, OrderDate, Amount), return the top 3 cities by total order amount along with their rank (output City, TotalAmount, Rank; only ranks 1-3).
Asked in the Round 1 live SQL stage. Wording restructured by OP with ChatGPT.
City, TotalAmount, and Rank.| Column | Type | Description |
|---|---|---|
| city | VARCHAR(100) | City associated with the order |
| orderdate | DATE | Date on which the order was placed |
| amount | DECIMAL(12,2) | Monetary value of the order |