HelloFresh wants a simple view of signup conversion performance by acquisition channel in the US marketing funnel. Write a SQL query to calculate conversion rate by acquisition_channel from a single table.
acquisition_channel.converted_to_subscriber = TRUE.converted_visitors / total_visitors, rounded to 4 decimal places.acquisition_channel is NULL.Table: hellofresh_web_sessions
| column | type | description |
|---|---|---|
| session_id | INT | Unique session identifier |
| visitor_id | INT | Visitor identifier |
| acquisition_channel | VARCHAR(50) | Marketing acquisition source |
| session_date | DATE | Date of the visit |
| converted_to_subscriber | BOOLEAN | Whether the visitor subscribed in that session |
| Column | Type | Description |
|---|---|---|
| session_idPK | INT | Unique session identifier |
| visitor_id | INT | Unique visitor identifier |
| acquisition_channel | VARCHAR(50) | Marketing channel that brought the visitor to HelloFresh |
| session_date | DATE | Date of the web session |
| converted_to_subscriber | BOOLEAN | Whether the visitor subscribed during the session |
You are practicing as a guest. Sign up free to run your code against the sample data. Your draft stays right here.