Loading...

Average Session Duration

A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.

Domain
SQL
Difficulty
medium
Seniority
junior, mid

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.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.