Your question is Top Three Businesses Per City. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Yelp wants to identify the most reviewed businesses in each city for local discovery and marketplace analysis. Write a PostgreSQL query that ranks every business within its city by the number of reviews it has received.
| Column | Type | Description |
|---|---|---|
| business_idPK | INT | Unique Yelp business identifier |
| business_name | VARCHAR(120) | Display name of the business |
| city | VARCHAR(80) | City where the business is located |
| Column | Type | Description |
|---|---|---|
| review_idPK | INT | Unique review identifier |
| business_id | INT | Business receiving the review |
| reviewer_name | VARCHAR(100) | Yelp member who wrote the review |
| review_text | TEXT | Review content |