Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
SQL Month-over-Month Growth
00:00
5 left

SQL Month-over-Month Growth

MediumSQL · PostgreSQL

Problem

GoFundMe’s Marketing Analytics team wants to monitor the monthly creation of new donation campaigns. Write a PostgreSQL query that calculates month-over-month growth across the full campaign date range.

Requirements

  1. Count eligible campaigns by calendar month using created_at.
  2. Exclude campaigns with status = 'deleted' and campaigns attributed to the test source type. Treat campaigns without a source record as organic.
  3. Include months with zero eligible campaigns between the first and last eligible campaign month.
  4. Return the current count, prior-month count, and growth percentage. Return NULL for growth when there is no prior month or the prior count is zero.

Schema

campaigns
ColumnTypeDescription
campaign_idPKINTEGERUnique GoFundMe campaign identifier
titleVARCHAR(150)Campaign title
created_atTIMESTAMPTimestamp when the campaign was created
statusVARCHAR(20)Campaign lifecycle status
campaign_sources
ColumnTypeDescription
source_idPKINTEGERUnique source attribution record
campaign_idINTEGERReferenced GoFundMe campaign
source_typeVARCHAR(30)Campaign acquisition source
Tablescampaignscampaign_sources
Interviewer

Your question is SQL Month-over-Month Growth. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.