Given a table of Squarespace user transactions, write a query to find the top three countries by revenue for each month.
Use completed transactions only and exclude transactions without a country. If countries tie on revenue, sort them alphabetically to determine the top three.
month, country, revenue, and country_rank.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | Squarespace user identifier |
| transaction_date | DATE | Date when the transaction occurred |
| country | VARCHAR(100) | User country associated with the transaction |
| revenue | DECIMAL(12,2) | Revenue recognized for the transaction |
| status | VARCHAR(20) | Transaction state |