Your question is Rolling 7-Day Conversion SQL. 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.
Shopify Marketing analysts monitor the performance of the Shopify Email channel across consecutive days. The team needs a rolling conversion rate that remains accurate when a day has traffic but no conversions, or no traffic at all.
Write a PostgreSQL query for the period from March 1 through March 10, 2025, using only the Shopify Email channel.
| Column | Type | Description |
|---|---|---|
| session_idPK | INT | Unique marketing session identifier |
| session_date | DATE | Date on which the session occurred |
| channel | VARCHAR(100) | Shopify Marketing attribution channel |
| campaign_name | VARCHAR(150) | Shopify Email campaign name |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| session_id | INT | Marketing session attributed to the order |
| order_date | DATE | Date on which the order was placed |
| status | VARCHAR(30) | Order lifecycle status |