Credit Karma wants to analyze how customers navigate its product experience. Write a PostgreSQL query that orders each customer's events chronologically, identifies session starts, and calculates the elapsed time since the previous event.
NULL for each customer's first event.| Column | Type | Description |
|---|---|---|
| customer_idPK | INTEGER | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's display name |
| VARCHAR(255) | Customer email address |
| Column | Type | Description |
|---|---|---|
| event_idPK | INTEGER | Unique event identifier |
| customer_id | INTEGER | Customer associated with the event |
| event_ts | TIMESTAMP | Time when the event occurred |
| event_type | VARCHAR(40) | Type of customer activity |
| channel | VARCHAR(30) | Access channel used for the event |