Write a query using window functions to rank users based on their total streaming hours within a specific calendar week on Roku streaming devices. Use the week from January 6 through January 12, 2025, and include only completed sessions on Roku devices.
user_id, user_name, total_streaming_hours, and streaming_rank.user_id ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Roku user identifier |
| user_name | VARCHAR(100) | Display name for the user |
| Column | Type | Description |
|---|---|---|
| session_idPK | INT | Unique streaming session identifier |
| user_id | INT | User who streamed during the session |
| device_type | VARCHAR(50) | Device platform used for streaming |
| started_at | TIMESTAMP | Session start timestamp |
| ended_at | TIMESTAMP | Session end timestamp, NULL for incomplete sessions |