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.

Exemplo de resposta esperada

É assim que se parece uma resposta correta: ela tem seu próprio número de linhas e não precisa coincidir com as tabelas do esquema. Sua resposta precisa retornar os mesmos nomes de colunas do exemplo: use AS para renomeá-las se for preciso.

user_idfirst_activity_date
1012026-01-05
1022026-01-03
1032026-01-08
PostgreSQLv16
Entre para enviar

O resultado da sua consulta aparecerá aqui

Focus radio
Paused · SomaFM · Fluid