← All SQL interview questions

Top 3 cities by revenue

MediumAggregate FunctionsSwiggyZomatoOla

A city-operations review opens with the three biggest revenue markets, strongest first.

From city_sales, return city and total_revenue, restricted to the top 3 cities by revenue and ordered from highest to lowest. Row order matters for this question.

Sample data

Table: city_sales

16 row(s) · showing first 8

sale_idINTcityTEXTsale_dateDATErevenueNUMERIC(10,2)
1Bengaluru2026-01-03185000.00
2Bengaluru2026-01-17162000.00
3Bengaluru2026-02-02174500.00
4Mumbai2026-01-05210000.00
5Mumbai2026-01-19198000.00
6Mumbai2026-02-04221000.00
7Delhi2026-01-07176000.00
8Delhi2026-01-21169000.00

Practising alone only goes so far — our live cohorts pair SQL depth with dashboards, agentic analytics projects and mock interviews.

Explore the program