Campaigns that never brought in a paying user
The task
A campaign brings in a user when the user's sign-up is credited to it (signups.campaign_id). Sign-ups with no campaign are organic.
List the campaigns where none of the users they brought in has ever made a purchase. Campaigns that brought in no users at all belong on the list too.
Return campaign_id and campaign_name, sorted by campaign_id.
Expected output
campaign_idcampaign_name- Sorted by campaign_id ascending.
- 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.
| int | Unique id. | |
| text | Name. | |
| text | search, social, video, email or affiliate. | |
| date | First day live. | |
| date | Last 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.
| int | The campaign. | |
| date | The day. | |
| int | Times an ad was shown. | |
| int | Clicks. | |
| 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.
| int | Unique id. | |
| timestamp | When they signed up (UTC). | |
| int | Credited campaign. NULL for organic sign-ups. | |
| text | Two-letter country code. |
purchases2,294 rows in the sample
One row per paid order by a user. Key: purchase_id.
| int | Unique id. | |
| int | Buyer. | |
| timestamp | When (UTC). | |
| numeric(10,2) | Order value, USD. |
Related questions
- Customers with savings but no open checking accountmedium
- Accounts billed since May with no paid invoicemedium
- Agents who got no urgent ticket in Aprileasy
- Customers with no completed order in Marcheasy
- Listeners who played no jazz in Junemedium
- New riders with no completed trip in their first 14 dayshard
Loading the editor and PostgreSQL
Loading the editor and PostgreSQL