
NovaApp wants to understand which product feature each user touches first after creating an account. Write a SQL query to return the first feature interaction that happened on or after each user's signup timestamp.
user_id, email, signup_at, feature_name, and first_interaction_at.event_id.user_id.users| column | type | description |
|---|---|---|
| user_id | INT | Primary key for each user |
| VARCHAR(255) | User email address | |
| signup_at | TIMESTAMP | Account creation timestamp |
| plan_tier | VARCHAR(50) | Subscription tier |
feature_events| column | type | description |
|---|---|---|
| event_id | INT | Primary key for each event |
| user_id | INT | User who triggered the event |
| feature_name | VARCHAR(100) | Product feature used |
| event_at | TIMESTAMP | Event timestamp |
| device_type | VARCHAR(50) | Device used for the event |
users| user_id | signup_at | plan_tier | |
|---|---|---|---|
| 101 | ava@novaapp.com | 2024-01-10 09:00:00 | free |
| 102 | ben@novaapp.com | 2024-01-10 10:30:00 | pro |
| 103 | cara@novaapp.com | 2024-01-11 08:15:00 | free |
feature_events| event_id | user_id | feature_name | event_at | device_type |
|---|---|---|---|---|
| 1005 | 101 | search | 2024-01-10 09:05:00 | web |
| 1002 | 101 | onboarding_checklist | 2024-01-10 09:05:00 | mobile |
| 1008 | 102 | dashboard | 2024-01-10 10:20:00 | web |
| user_id | signup_at | feature_name | first_interaction_at | |
|---|---|---|---|---|
| 101 | ava@novaapp.com | 2024-01-10 09:00:00 | onboarding_checklist | 2024-01-10 09:05:00 |
| 102 | ben@novaapp.com | 2024-01-10 10:30:00 | upload_file | 2024-01-10 10:30:00 |
| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique identifier for a user |
| VARCHAR(255) | User email address | |
| signup_at | TIMESTAMP | Timestamp when the user signed up |
| plan_tier | VARCHAR(50) | Subscription plan tier |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique identifier for an event |
| user_id | INT | User who generated the event |
| feature_name | VARCHAR(100) | Name of the feature the user interacted with |
| event_at | TIMESTAMP | Timestamp of the feature interaction |
| device_type | VARCHAR(50) | Device type used for the interaction |
{"users":[[101,"ava@novaapp.com","2024-01-10 09:00:00","free"],[102,"ben@novaapp.com","2024-01-10 10:30:00","pro"],[103,"cara@novaapp.com","2024-01-11 08:15:00","free"],[104,"dan@novaapp.com","2024-01-12 12:00:00","enterprise"],[105,"ella@novaapp.com","2024-01-12 12:00:00",null],[106,"finn@novaapp.com","2024-01-13 14:45:00","pro"],[107,"gina@novaapp.com","2024-01-14 16:20:00","free"],[108,"hugo@novaapp.com","2024-01-15 09:10:00","pro"],[109,"ivy@novaapp.com","2024-01-16 11:00:00","free"],["1","oOutput[["7","sam@novaapp.com","2024-01-11 06:33:05","dashboard","2024-01-18 20:35:53"],["101","ava@novaapp.com","2024-01-10 09:00:00","onboarding_checklist","2024-01-10 09:05:00"],["102","ben@novaapp.com","2024-01-10 10:30:00","upload_file","2024-01-10 10:30:00"],["103","cara@novaapp.com","2024-01-11 08:15:00","invite_teammate","2024-01-11 08:16:00"],["104","dan@novaapp.com","2024-01-12 12:00:00","export_csv","2024-01-12 12:00:00"],["105","ella@novaapp.com","2024-01-12 12:00:00","null","2024-01-12 12: