Your question is SQL Top 3 Campaigns by Conversion. 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.
Digitas México needs a monthly view of campaign efficiency across paid media campaigns. Write a PostgreSQL query to identify the three campaigns with the highest conversion rate for each month.
campaigns to campaign_metrics using campaign_id.campaign_id.| Column | Type | Description |
|---|---|---|
| campaign_idPK | INT | Unique campaign identifier |
| campaign_name | VARCHAR(150) | Campaign display name |
| status | VARCHAR(20) | Campaign lifecycle status |
| Column | Type | Description |
|---|---|---|
| metric_idPK | INT | Unique metrics record identifier |
| campaign_id | INT | Campaign associated with the metrics |
| metric_date | DATE | Date on which metrics were recorded |
| impressions | INT | Number of impressions |
| conversions | INT | Number of attributed conversions |