Given a database schema for ad impressions and clicks, write a query to calculate the daily click-through rate (CTR) grouped by campaign category.
Use the provided tables and include dates and categories with impressions even when no clicks occurred. CTR should be expressed as a percentage.
Output
- One row per impression date and campaign category.
- Columns:
campaign_category, impression_date, impressions, clicks, and ctr_percentage.
- Include zero-click groups, exclude clicks that do not match an impression, and order by
impression_date, then campaign_category.