Your question is 7-Day Rolling Average Conversions. 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.
Corsair's Marketing Analytics team wants to monitor conversion trends for a campaign promoting the Corsair K70 RGB keyboard. Write a PostgreSQL query that reports daily conversions and smooths short-term variation with a 7-day rolling average.
Corsair K70 RGB campaign by joining the campaign metadata table.| Column | Type | Description |
|---|---|---|
| campaign_idPK | INTEGER | Unique campaign identifier |
| campaign_name | VARCHAR(100) | Campaign or promoted Corsair product name |
| channel | VARCHAR(50) | Marketing acquisition channel |
| Column | Type | Description |
|---|---|---|
| conversion_idPK | INTEGER | Unique conversion event identifier |
| campaign_id | INTEGER | Campaign associated with the conversion |
| conversion_date | DATE | Date on which the conversion occurred |
| source | VARCHAR(50) | Detailed traffic source |