Ad click-through conversion rate, per campaign
Marketing wants to know how well each ad campaign converts a click into real intent. For each campaign, compute the click-through conversion rate: the percentage of users who clicked the ad *and* went on to add an item to their cart.
Return campaign and conversion_rate (a percentage, rounded to 1 decimal place).
Schema
| id | INT |
| user_id | INT |
| campaign | TEXT |
| id | INT |
| user_id | INT |
| campaign | TEXT |
Basic
The example input, expected output, and walkthrough for this question unlock with a Basic plan.
Basic
The reference solution and walkthrough for this question unlock with a Basic plan.
Basic
This is a Basic question
Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.
RM 25/mo · cancel anytime
The interviewer's next question
Drop the per-campaign breakdown and give one headline number: across all campaigns combined, what fraction of clickers went on to add something to cart? Return a single row, conversion_rate (percentage, 1 decimal).
Solving follow-ups — the questions an interviewer actually asks next — unlocks with a Basic plan.
See Basic plansRM 25/mo · cancel anytime
Marketing wants to see the drop-off directly: for each campaign, how many distinct users clicked but never added to cart? Return campaign and non_converters.
Solving follow-ups — the questions an interviewer actually asks next — unlocks with a Basic plan.
See Basic plansRM 25/mo · cancel anytime