
Asana’s growth team wants to measure how many new users activate quickly after signup. Write a SQL query to identify users who activated within 24 hours of signup.
user_id whose activated_at timestamp is within 24 hours after signup_at.signup_at, activated_at, and the activation lag in hours.user_id.asana_user_lifecycle
| column | type | description |
|---|---|---|
| user_id | INT | Unique user identifier |
| VARCHAR(255) | User email address | |
| signup_at | TIMESTAMP | Time the user created an Asana account |
| activated_at | TIMESTAMP | Time the user completed the activation event in Asana |
| signup_surface | VARCHAR(100) | Surface where the signup started |
| user_id | signup_at | activated_at | signup_surface | |
|---|---|---|---|---|
| 104 | devon@company.com | 2024-04-03 09:00:00 | 2024-04-04 09:00:00 | web |
| 101 | maya@company.com | 2024-04-01 08:00:00 | 2024-04-01 12:00:00 | web |
| 108 | noah@company.com | 2024-04-05 14:00:00 | 2024-04-06 13:59:00 | mobile |
| 103 | iris@company.com | 2024-04-02 15:00:00 | NULL | enterprise_demo |
| 106 | zane@company.com | 2024-04-04 20:00:00 | 2024-04-04 19:00:00 | web |
| 102 | leo@company.com | 2024-04-01 10:30:00 | 2024-04-02 11:00:00 | mobile |
| user_id | signup_at | activated_at | activation_hours |
|---|---|---|---|
| 101 | 2024-04-01 08:00:00 | 2024-04-01 12:00:00 | 4.00 |
| 104 | 2024-04-03 09:00:00 | 2024-04-04 09:00:00 | 24.00 |
| 108 | 2024-04-05 14:00:00 | 2024-04-06 13:59:00 | 23.98 |
| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| VARCHAR(255) | User email address | |
| signup_at | TIMESTAMP | Timestamp when the user signed up for Asana |
| activated_at | TIMESTAMP | Timestamp when the user completed the activation event |
| signup_surface | VARCHAR(100) | Surface where the signup originated |
{"asana_user_lifecycle":[[104,"devon@company.com","2024-04-03 09:00:00","2024-04-04 09:00:00","web"],[101,"maya@company.com","2024-04-01 08:00:00","2024-04-01 12:00:00","web"],[108,"noah@company.com","2024-04-05 14:00:00","2024-04-06 13:59:00","mobile"],[103,"iris@company.com","2024-04-02 15:00:00",null,"enterprise_demo"],[106,"zane@company.com","2024-04-04 20:00:00","2024-04-04 19:00:00","web"],[102,"leo@company.com","2024-04-01 10:30:00","2024-04-02 11:00:00","mobile"],[110,"ava@company.com","Output[["13","2024-03-31 09:12:09","2024-04-01 06:46:09","21.57"],["101","2024-04-01 08:00:00","2024-04-01 12:00:00","4.00"],["104","2024-04-03 09:00:00","2024-04-04 09:00:00","24.00"],["105","2024-04-03 11:15:00","2024-04-03 11:15:00","0.00"],["108","2024-04-05 14:00:00","2024-04-06 13:59:00","23.98"],["109","2024-04-05 16:45:00","2024-04-05 18:45:00","2.00"]]