Write a SQL query to find the median session duration per user segment.
Use the users and sessions tables. Exclude sessions with a NULL duration and users without a segment.
segment, median_duration_secondssegment| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | User display name |
| segment | VARCHAR(50) | User segment |
| Column | Type | Description |
|---|---|---|
| session_idPK | INT | Unique session identifier |
| user_id | INT | User associated with the session |
| duration_seconds | INT | Session duration in seconds |