Top 3 Cities by Completed Trades
Problem
**[Asked at Robinhood]**
Robinhood wants to know which cities are most active on the platform.
Write a query to find the **top 3 cities by number of completed trade orders**
(status = 'Completed'), listed in descending order.
Return `city` and `completed_trades`.
Tables
Example rows — the live problem includes the full dataset.
users
| user_id | name | city |
|---|
trades
| trade_id | user_id | status | trade_date |
|---|
Expected output
Your answer should return 3 rows with the columns city, completed_trades.
Starter code (SQL)
SELECT *
FROM users;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock