Days with Impressions but No Clicks

For each campaign that had at least one day with impressions but zero clicks, count those days.

Expected output

name, channel, zero_click_days. Sorted by zero_click_days descending, then name.

Row order is checked. Column names are not checked; numbers are compared to 2 decimals.

Dataset: Digital ads performance

A retailer's paid campaigns across search, social, display and video in February 2026: daily delivery, individual ad clicks and purchases.

campaigns

One row per campaign.

campaign_idINTEGERprimary key
nameTEXT
channelTEXTsearch, social, display or video
start_dateTEXTYYYY-MM-DD
end_dateTEXTYYYY-MM-DD inclusive, NULL if still running
daily_budgetREALUSD
ad_daily

Delivery per campaign per day it ran, as reported by the ad platform. clicks is the platform's count, which may differ from our own click log.

campaign_idINTEGER
dayTEXTYYYY-MM-DD
impressionsINTEGER
clicksINTEGER
spendREALUSD
ad_clicks

Our own click log: one row per ad click that reached the site and was tracked.

click_idINTEGERprimary key, increases with clicked_at
campaign_idINTEGER
user_idINTEGER
clicked_atTEXTYYYY-MM-DD HH:MM:SS (UTC)
conversions

One row per purchase. Some purchases come from users who never clicked an ad.

conversion_idINTEGERprimary key
user_idINTEGER
converted_atTEXTYYYY-MM-DD HH:MM:SS (UTC)
revenueREALUSD

Engine: SQLite. Dates are text (YYYY-MM-DD); use strftime(), date() and julianday() for date math.

Related problems

SQLite · runs in your browser
Ctrl/⌘ + Enter to run
Expected output preview (6 rows, order matters)
namechannelzero_click_days
Search - Spring Salesearch3
Social Prospectingsocial3
Display Remarketingdisplay1

Showing 3 of 6 rows.

Hints

Worked solution

Run at least one query to unlock it.