Given a table of user DNA activation dates and subsequent login dates, write a query to find the average time to first discovery.
Treat the first discovery as the earliest login on or after the user's DNA activation date. Users without a qualifying login, and rows with NULL activation or login dates, are ignored.
average_time_to_first_discovery_days.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique identifier for the user |
| activation_date | DATE | Date the user activated their DNA kit |
| Column | Type | Description |
|---|---|---|
| login_idPK | INT | Unique identifier for the login event |
| user_id | INT | User associated with the login |
| login_date | DATE | Date of the login event |