

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 |
| session_id | visitor_id | acquisition_channel | session_date | converted_to_subscriber |
|---|---|---|---|---|
| 5 | 1005 | Paid Search | 2024-01-02 | false |
| 1 | 1001 | Paid Social | 2024-01-03 | true |
| 9 | 1009 | Referral | 2024-01-04 | true |
| 3 | 1003 | Organic Search | 2024-01-02 | false |
| 11 | 1011 | 2024-01-06 | true | |
| 2 | 1002 | Paid Social | 2024-01-01 | false |
| 8 | 1008 | Referral | 2024-01-03 | false |
| 6 | 1006 | Paid Search | 2024-01-05 | true |
| 4 | 1004 | Organic Search | 2024-01-04 | false |
| 10 | 1010 | NULL | 2024-01-05 | true |
| acquisition_channel | total_visitors | converted_visitors | conversion_rate |
|---|---|---|---|
| 2 | 1 | 0.5000 | |
| Referral | 2 | 1 | 0.5000 |
| Paid Search | 3 | 1 | 0.3333 |
| Paid Social | 3 | 1 | 0.3333 |
| Organic Search | 2 | 0 | 0.0000 |
| 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 |
{"hellofresh_web_sessions":[[5,1005,"Paid Search","2024-01-02",false],[1,1001,"Paid Social","2024-01-03",true],[9,1009,"Referral","2024-01-04",true],[3,1003,"Organic Search","2024-01-02",false],[11,1011,"Email","2024-01-06",true],[2,1002,"Paid Social","2024-01-01",false],[8,1008,"Referral","2024-01-03",false],[6,1006,"Paid Search","2024-01-05",true],[4,1004,"Organic Search","2024-01-04",false],[10,1010,null,"2024-01-05",true],[7,1007,"Paid Search","2024-01-01",false],[12,1012,"Email","2024-01-02Output[["Email","2","1","0.5000"],["Paid Social","2","1","0.5000"],["Referral","2","1","0.5000"],["Paid Search","3","1","0.3333"],["Organic Search","2","0","0.0000"],["Push Notification","1","0","0.0000"]]