Click-Through Rate by Channel

easyfree, no signupAggregation & GROUP BYJoins

Compute impressions, clicks and click-through rate (CTR = clicks / impressions) for each channel over February 2026.

Expected output

channel, impressions, clicks, ctr_pct (percentage rounded to 2 decimals). Sorted by ctr_pct descending.

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 (4 rows, order matters)
channelimpressionsclicksctr_pct
search169456483.82
social304843331.09
video173271460.84

Showing 3 of 4 rows.

Hints

Worked solution

Run at least one query to unlock it.