Your question is CTR by Region and Device. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Yelp Ads needs a performance report for advertiser 101. Write a PostgreSQL query that calculates click-through rates for impressions served during June 2024, segmented by geographic region and device type.
Unknown.| Column | Type | Description |
|---|---|---|
| impression_idPK | INT | Unique impression identifier |
| advertiser_id | INT | Yelp Ads advertiser identifier |
| region | VARCHAR(50) | Geographic region where the impression occurred |
| device_type | VARCHAR(20) | Device used to view the advertisement |
| impression_ts | TIMESTAMP | Timestamp when the ad impression occurred |
| Column | Type | Description |
|---|---|---|
| click_idPK | INT | Unique click event identifier |
| impression_id | INT | Impression associated with the click |
| clicked_at | TIMESTAMP | Timestamp when the click occurred |