Facebook wants to measure habit strength by finding each user's longest streak of consecutive daily activity. Write a SQL query to return the longest daily activity streak per user.
user_id, longest streak length, streak start date, and streak end date.user_id ascending.| Column | Type | Description |
|---|---|---|
| activity_idPK | INT | Unique identifier for each activity event |
| user_id | INT | Facebook user identifier |
| activity_date | TIMESTAMP | Timestamp when the activity occurred |
| surface | VARCHAR(50) | Meta surface where the event occurred |
| activity_type | VARCHAR(50) | Type of activity performed |
| device_type | VARCHAR(20) | Device used for the activity |