Given two tables (Campaigns and Impressions), how would you find the click-through rate per campaign?
Assume each impression has a Boolean clicked value. Include campaigns with no impressions, treat their impression and click counts as zero, and calculate click-through rate as clicks divided by impressions, expressed as a percentage.
campaign_id, campaign_name, impression_count, click_count, and click_through_ratecampaign_id ascending| Column | Type | Description |
|---|---|---|
| campaign_idPK | INT | Unique campaign identifier |
| campaign_name | VARCHAR(150) | Campaign display name |
| Column | Type | Description |
|---|---|---|
| impression_idPK | INT | Unique impression identifier |
| campaign_id | INT | Campaign associated with the impression |
| clicked | BOOLEAN | Whether the impression generated a click |