Write a SQL query using window functions to rank marketing channels by their conversion rate within each calendar month at Prosper Marketplace.
Use the provided channel and marketing event data. Define conversion rate as conversions divided by visits. Exclude channel-month combinations with no visits.
month_start, channel_name, visits, conversions, conversion_rate, and monthly_rank.month_start, monthly_rank, then channel_name.| Column | Type | Description |
|---|---|---|
| channel_idPK | INT | Unique marketing channel identifier |
| channel_name | VARCHAR(100) | Prosper marketing channel name |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique marketing event identifier |
| channel_id | INT | Marketing channel associated with the event |
| occurred_at | TIMESTAMP | Timestamp when the event occurred |
| event_type | VARCHAR(30) | Event classification, either visit or conversion |