A Customer's First Digital Footprint

A Customer's First Digital Footprint

You are a product analyst at Northstar, a mobile banking startup. The onboarding team wants to know when each customer first became active in the app so future acquisition campaigns can be compared by activation speed. The app_events table stores customer actions. A customer may generate several events on the same day, including events with identical timestamps. Rows where occurred_at IS NULL are incomplete technical records and must be ignored. Customers with no event that has a valid timestamp must not appear in the result. Find the calendar date of each customer's earliest activity. Return: - user_id — customer identifier; - first_activity_date — earliest activity date in YYYY-MM-DD format. Sort by user_id ascending. Duplicate events must not create extra rows.

Expected output sample

This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables. Your answer must use the same column names as this sample — alias them with AS if needed.

user_idfirst_activity_date
1012026-01-05
1022026-01-03
1032026-01-08
PostgreSQLv16

Your query result will appear here

Focus radio
Paused · SomaFM · Fluid