You're analyzing monetization for an audiobook app. The subscription team wants to compare all listeners by their number of completed purchases in the second quarter of 2026, including listeners who made no purchases. Each separate purchase record counts as one purchase, even if the same user made two purchases in the exact same second.
Return these columns:
- listener_id — listener identifier, integer
- listener_name — listener name
- purchase_frequency — number of completed purchases from 2026-04-01 inclusive to 2026-07-01 exclusive, integer
Rules:
- Return all listeners from listeners, including those with a frequency of 0.
- Count only records with status completed and a non-NULL completed_at within the specified half-open interval.
- Different purchase_id values count as separate purchases; identical timestamps do not make purchases duplicates.
- Sort by purchase_frequency in descending order, then by listener_id in ascending order.
- No rounding is required; purchase_frequency must not be NULL.
listener_idlistener_namepurchase_frequencyShowing the first 3 rows of the sample — the full sample comes with Premium
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in