All problems
How Many Cities Does UrbanHop Serve?
easySQLBasics
UrbanHop's expansion team wants a quick headcount.
riders
| id | name | city | signup_date |
|---|---|---|---|
| 1 | Maya Chen | Austin | 2023-01-05 |
| 2 | Noah Patel | Denver | 2023-02-14 |
| 3 | Zara Ahmed | Austin | 2023-03-01 |
| 4 | Leo Kim | Seattle | 2023-04-20 |
| 5 | Ivy Brooks | Denver | 2023-05-11 |
Task: Write a query that returns how many different cities the riders come from, as num_cities.
Example output — shape only. If the riders were spread across six cities, the single row would read:
| num_cities |
|---|
| 6 |
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in