All SQL problems
MediumGROUP BY
Revenue per city
Total delivered revenue per city, sorted so the top city is first.
- #group-by-join
- #revenue
Schema (SQLite, in-browser)
customers (id, name, city, signup_date) products (id, name, category, price) orders (id, customer_id, order_date, status) order_items (order_id, product_id, quantity)
Sample input
18 orders across 4 cities
Expected shape
4 rows
sql-revenue-by-city.sqlSQLite
Result
Press “Run query” to execute against the sample database.
