SQL · Pinterest · Medium
Two tables are available: events(event_id, user_id, pin_id, event_type, event_ts, country_code) records user activity on Pins; the event_type column holds one of two values, impression or click. pin_info(pin_id, category) assigns every Pin to a category. Write a single SQL query that measures how engaging each category is, restricted to events from the latest 30 calendar days (today counts as one of those 30 days). The query should: Connect the two tables through pin_id. For…