A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- L3
Problem
The engagement team wants each user's average session duration, defined as their total time in sessions divided by their total number of sessions. Exclude any sessions missing a recorded duration. Return the user ID and their average.
Summary
How long do users actually stay?
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.