Write a query to calculate the total pageviews and unique visitors for a specific feature on LinkedIn, grouped by day and user segment. Use Jobs as the feature and treat each matching event row as one pageview. Include only events with a matching user record, including users whose segment is NULL.
viewed_day, user_segment, total_pageviews, and unique_visitorsviewed_day ascending, then user_segment ascending with NULL segments last| Column | Type | Description |
|---|---|---|
| pageview_idPK | INT | Unique identifier for the pageview event |
| viewed_at | TIMESTAMP | Timestamp when the feature pageview occurred |
| feature_name | VARCHAR(100) | LinkedIn feature viewed by the visitor |
| visitor_id | VARCHAR(50) | Identifier for the visitor |
| user_id | INT | LinkedIn user associated with the event |
| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique LinkedIn user identifier |
| user_segment | VARCHAR(50) | Analytical segment assigned to the user |