streams has one row per play (user_id, track_id, listened_seconds). For each listener and track, compute the total listening time in minutes (total seconds / 60). Output columns: user_id, track_id, listening_minutes (rounded to 2 decimals). Order by user_id, then track_id.
| Column | Type |
|---|---|
| user_id | INTEGER |
| track_id | INTEGER |
| listened_seconds | INTEGER |
| user_id | track_id | listened_seconds |
|---|---|---|
| 1 | 10 | 180 |
| 1 | 10 | 120 |
| 1 | 11 | 240 |
| 2 | 10 | 60 |
| 2 | 11 | 300 |
| user_id | track_id | listening_minutes |
|---|---|---|
| 1 | 10 | 5 |
| 1 | 11 | 4 |
| 2 | 10 | 1 |
| 2 | 11 | 5 |
Solve it in the live editor on this page — run on sample data, then submit against hidden tests.
‹ New Member Activation · Complete Service Bundle Subscribers ›
{{ totalCount }} questions in the style asked at Amazon, Microsoft, Google, Meta, Flipkart and more — {{ hardPct }}% Hard. Write SQL in a real database engine in your browser, run it on sample data, then evaluate against hidden tests.
Company tags show where this type of question is commonly reported in interviews. Questions, data and solutions are written by TechTown.
{{ cur.statement }}
No submissions yet. Press Evaluate to submit your query.
{{ solutionSql }}
{{ out.error }}
You have solved your 3 free questions — nice work! Log in (free) to unlock all 150 questions, keep your streak and appear on the leaderboard.