SQL · Meta · Easy
Assume an impressions table records every time an advertisement is displayed. The table has the columns ad_id, timestamp, and user_id. Write an SQL query that returns the total number of impressions associated with each advertisement. Sample Input Table impressions: ad_id timestamp user_id 3 2024-02-10 09:15:00 205 3 2024-02-10 09:20:00 219 7 2024-02-10 09:45:00 205 Expected Output ad_id impression_count 3 2 7 1 Example Input: Output: ad_id impression_count 4 2 9 1…
Checking your access…