Your question is Top Campaigns Per Region With Dense Rank. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
EXL Service Philippines marketing analysts need to compare campaign performance across regional markets. Write a PostgreSQL query that identifies the highest-performing campaigns in each region based on total conversions.
DENSE_RANK() to rank campaigns separately within each region.| Column | Type | Description |
|---|---|---|
| campaign_idPK | INT | Unique campaign identifier |
| campaign_name | VARCHAR(100) | Name of the marketing campaign |
| region | VARCHAR(50) | Philippine region targeted by the campaign |
| Column | Type | Description |
|---|---|---|
| performance_idPK | INT | Unique performance record identifier |
| campaign_id | INT | References campaigns.campaign_id |
| reporting_date | DATE | Date covered by the performance record |
| conversions | INT | Number of attributed conversions |