Rippling’s growth team wants to compare signup conversion performance across acquisition channels for a recent campaign. Write a SQL query to calculate conversion rates by channel using a single event table.
channel, count how many users had a visit event.signup event.channel, visits, signups, and conversion_rate where conversion_rate = signups / visits.channel is NULL.conversion_rate descending, then channel ascending.rippling_growth_events
| column | type | description |
|---|---|---|
| event_id | INT | Unique event row ID |
| user_id | INT | User identifier |
| channel | VARCHAR(50) | Acquisition channel tied to the event |
| event_type | VARCHAR(20) | Event type such as visit or signup |
| event_date | DATE | Date of the event |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event row ID |
| user_id | INT | User identifier |
| channel | VARCHAR(50) | Acquisition channel associated with the event |
| event_type | VARCHAR(20) | Event type such as visit or signup |
| event_date | DATE | Date the event occurred |
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.