Your question is Offer Conversion Rate by Campaign. Start with the requirements and the one table 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.
You are given a table of customer-level offer outcomes from PNC marketing campaigns. Write a SQL query to calculate the percentage of customers who converted after receiving an offer for each campaign_name. Treat a customer as converted only when converted = TRUE. Return the campaign name, the total number of customers who received the offer, the number who converted, and the conversion percentage rounded to 2 decimal places. Sort the results by conversion percentage descending, then by campaign name.
| Column | Type | Description |
|---|---|---|
| offer_idPK | INT | Unique identifier for each offer event row |
| customer_id | INT | Customer who received the offer |
| campaign_name | VARCHAR(100) | PNC marketing campaign name |
| channel | VARCHAR(50) | Offer delivery channel |
| converted | BOOLEAN | Whether the customer converted after receiving the offer |
| offer_date | DATE | Date the offer was sent |