Rippling's growth team launched a campaign in Rippling Spend on 2024-02-15 and wants a quick before-vs-after performance read. Write a SQL query to compare daily campaign performance for the periods before and after launch.
campaign_events table.Before Launch and After Launch.total_impressionstotal_clickstotal_signupsctr = total_clicks / total_impressionssignup_rate = total_signups / total_clicksevent_date is between 2024-02-08 and 2024-02-21 inclusive.2024-02-15 as Before Launch, and dates on or after 2024-02-15 as After Launch.period so After Launch appears first.| column | type | description |
|---|---|---|
| event_id | INT | Primary key for each daily campaign record |
| event_date | DATE | Date of campaign activity |
| campaign_name | VARCHAR(100) | Campaign name in Rippling Spend |
| impressions | INT | Number of impressions recorded that day |
| clicks | INT | Number of clicks recorded that day |
| signups | INT | Number of signups attributed that day |
| channel | VARCHAR(50) | Marketing channel |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Primary key for each daily campaign record |
| event_date | DATE | Date of campaign activity |
| campaign_name | VARCHAR(100) | Campaign name in Rippling Spend |
| impressions | INT | Number of impressions recorded that day |
| clicks | INT | Number of clicks recorded that day |
| signups | INT | Number of signups attributed that day |
| channel | VARCHAR(50) | Marketing channel |
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.