Write a query using window functions to rank sitters in each city based on their average rating and total completed bookings.
Use the sitters and bookings tables. Include sitters with at least one completed booking, even when their completed bookings have no rating.
city, sitter_id, sitter_name, average_rating, completed_bookings, and city_rank.city, city_rank, and sitter_id.| Column | Type | Description |
|---|---|---|
| sitter_idPK | INT | Unique identifier for the sitter |
| sitter_name | VARCHAR(100) | Sitter display name |
| city | VARCHAR(100) | City where the sitter provides services |
| Column | Type | Description |
|---|---|---|
| booking_idPK | INT | Unique booking identifier |
| sitter_id | INT | Sitter assigned to the booking |
| status | VARCHAR(30) | Booking status |
| rating | DECIMAL(3,2) | Customer rating for the booking |