SQL · Pinterest · Medium
You are working with a single table that logs every time a pin is shown to a user: impressions(impression_id, user_id, pin_id, surface, impression_ts, country_code) The surface column records where the impression happened; sample values are home, search, and related_pins. Users must be assessed separately per country: a person's activity in one country never counts toward their status in another. Write a SQL query that reports, for every country, what percentage of its users…