Skip to content

Sign-ups who never bought, by sign-up month

The task

Growth wants to know how many sign-ups never turned into a customer, month by month.

A user "never bought" if they have no purchase at or after their sign-up time: no row in purchases for the user with purchased_at >= signups.signed_up_at. A purchase recorded before the sign-up time (for example a guest order merged into the account) does not count. Group users by the calendar month of signed_up_at.

Return signup_month (the first day of the month), signups, never_bought (users who never bought) and never_bought_pct (as a percentage of that month's sign-ups, rounded to 1 decimal place). Sort by signup_month.

Expected output

signup_monthsignupsnever_boughtnever_bought_pct
  • Sorted by signup_month ascending.
  • Numbers rounded to 1 decimal place.
  • Checked on the sample and on 2 hidden datasets. How grading works

Tables Marketing team · click a name to insert it

campaigns10 rows in the sample

One row per campaign. Key: campaign_id.

intUnique id.
textName.
textsearch, social, video, email or affiliate.
dateFirst day live.
dateLast day live. NULL if still running.
numeric(10,2)Budget per day, USD.
ad_daily969 rows in the sample

One row per campaign per day it served ads. Days with no delivery have no row. Key: campaign_id, day.

intThe campaign.
dateThe day.
intTimes an ad was shown.
intClicks.
numeric(10,2)Money spent, USD.
signups2,108 rows in the sample

One row per new user. campaign_id is the campaign credited with the sign-up. Key: user_id.

intUnique id.
timestampWhen they signed up (UTC).
intCredited campaign. NULL for organic sign-ups.
textTwo-letter country code.
purchases2,294 rows in the sample

One row per paid order by a user. Key: purchase_id.

intUnique id.
intBuyer.
timestampWhen (UTC).
numeric(10,2)Order value, USD.

Related questions

Loading the editor and PostgreSQL