Sovrn wants to identify the advertisers contributing the most spend to its advertising marketplace each month. Write a PostgreSQL query that aggregates advertiser spend by calendar month and ranks advertisers within each month.
YYYY-MM, advertiser name, total spend, and rank, ordered chronologically by month and then by rank.| Column | Type | Description |
|---|---|---|
| advertiser_idPK | INTEGER | Unique advertiser identifier |
| advertiser_name | VARCHAR(100) | Advertiser display name |
| Column | Type | Description |
|---|---|---|
| spend_idPK | INTEGER | Unique spend record identifier |
| advertiser_id | INTEGER | Advertiser associated with the spend record |
| spend_date | DATE | Date on which spend was recorded |
| spend_amount | NUMERIC(12,2) | Amount spent by the advertiser |