Back to problems

Write SQL for retention, conversion, and churn

SQL · Meta · Hard

You are analyzing event data for a marketplace application. Today is 2025-09-01. All event timestamps are stored as UTC TIMESTAMP values without time zone. Each user record contains an IANA time zone in tz; use that time zone to convert every event timestamp to the user's local calendar date before any daily aggregation or window comparison. In PostgreSQL, the conversion is: $$(\text{ts AT TIME ZONE 'UTC' AT TIME ZONE u.tz})::\text{date}$$ Schema: The status column contains…

Checking your access…