2 tables: ads and events
ads table fields: ad_id, campaign_id, status.
Events table fields: event_id, ad_id, source, event_type
event_type has values: impression, click, conversion
ad_id has values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
CTR calculated field = number of impressions / number of clicks as a percentage
CVR calculated field = number of impressions / number of conversion as a percentage
How do i write an SQL query with the output to be:
ad_id | CTR | CVR
the output should be grouped by ad_id.