Write a SQL query to rank venues within each city by visit count and return the top 3 per city.
Assume each row in visits represents one visit. Include venues with no visits, break equal visit counts by ascending venue_id, and use a one-based rank.
city_name, venue_id, venue_name, visit_count, and city_rank.city_name, city_rank, and venue_id.| Column | Type | Description |
|---|---|---|
| city_idPK | INTEGER | Unique city identifier |
| city_name | VARCHAR(100) | City name |
| Column | Type | Description |
|---|---|---|
| venue_idPK | INTEGER | Unique venue identifier |
| city_id | INTEGER | City containing the venue |
| venue_name | VARCHAR(150) | Venue name |
| Column | Type | Description |
|---|---|---|
| visit_idPK | INTEGER | Unique visit identifier |
| venue_id | INTEGER | Venue visited |
| visited_at | TIMESTAMP | Timestamp of the visit |