Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Monthly Campaign Performance Summary

EasySQL · PostgreSQL00:00
I
Practice interviewer
Your interviewer
In session
I
Interviewer

Welcome to the SQL screen.

The question is on your right: Monthly Campaign Performance Summary. Read through the requirements and the one table first.

Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?

You need to log in / sign up to run or submit.

Problem

BrightAds wants a simple monthly view of marketing performance from its campaign delivery table. Write a SQL query to summarize campaign results for January 2024.

Requirements

  1. Return one row per channel for campaigns with campaign_date in January 2024.
  2. For each channel, calculate:
    • total impressions
    • total clicks
    • average spend
  3. Sort the result by total_clicks in descending order.

Schema

marketing_campaigns
ColumnTypeDescription
campaign_idPKINTUnique campaign record identifier
channelVARCHAR(50)Marketing channel
campaign_nameVARCHAR(100)Campaign name
campaign_dateDATEDate the campaign ran
impressionsINTNumber of impressions
clicksINTNumber of clicks
spendDECIMAL(10,2)Campaign spend amount
regionVARCHAR(50)Campaign region
Tablesmarketing_campaigns
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results