Back to problems

Compute multi-account activity and unread percentages in SQL

SQL · Meta · Medium

You are working with two tables, notifications and dim_circle_people. The second one is a daily snapshot — at most one row exists per (person_id, userid, ds) — and it records which real person (person_id) owns which account (userid); one person may control several accounts. The first table stores one notification event per row. Only snapshot rows carrying ds = '2025-09-01' from dim_circle_people may be used in any query. Define "last month" as the interval from 2025-08-01…

Checking your access…