Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Diagnose Campaign Performance Drops
00:00
5 left

Diagnose Campaign Performance Drops

MediumSQL · PostgreSQL

Problem

Explain how you would utilize Python, R, or advanced spreadsheet functions to diagnose an unexpected drop in marketing campaign performance.

For this SQL exercise, use the supplied weekly campaign and regional benchmark data to identify campaigns whose latest conversion rate declined materially from the previous week and declined more than their regional benchmark.

Output

  1. Return one row per qualifying campaign with campaign_name, channel, region, previous_conversion_rate, latest_conversion_rate, campaign_drop_pct, and benchmark_change_pct.
  2. Include only campaigns with at least a 20% conversion-rate decline and a worse decline than the regional benchmark.
  3. Sort by campaign_drop_pct descending, then campaign_name ascending.

Schema

campaigns
ColumnTypeDescription
campaign_idPKINTUnique campaign identifier
campaign_nameVARCHAR(100)Campaign name
channelVARCHAR(50)Marketing channel
statusVARCHAR(20)Campaign status
campaign_weekly_performance
ColumnTypeDescription
performance_idPKINTUnique weekly performance record
campaign_idINTCampaign associated with the weekly metrics
regionVARCHAR(30)Regional reporting segment
week_startDATEStart date of the reporting week
clicksINTWeekly clicks
conversionsINTWeekly conversions
regional_benchmarks
ColumnTypeDescription
benchmark_idPKINTUnique benchmark record
regionVARCHAR(30)Regional benchmark segment
week_startDATEStart date of the benchmark week
conversion_rateDECIMAL(8,4)Regional benchmark conversion rate
Tablescampaignscampaign_weekly_performanceregional_benchmarks
Interviewer

Your question is Diagnose Campaign Performance Drops. Start with the requirements and the three 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.