Last Updated: May 12, 2026
For this exercise, we will work with below data:
Write a query that returns both the continuous and the discrete median of track duration_seconds side by side.
Write a query that returns the 25th, 50th, 75th, and 90th percentiles of track duration_seconds.
Write a query that returns the median track duration per genre using PERCENTILE_CONT. Show the genre, track_count, and median_duration. Order alphabetically by genre.
Write a query that returns the median duration_listened for each user using PERCENTILE_CONT. Show username and median_listen rounded to 1 decimal. Order alphabetically by username.
Write a query that returns the global mean and median of payment amount for completed payments side by side, both rounded to 2 decimals.
Write a query that returns the median total streams per user (counting all streams across all days). Use PERCENTILE_CONT on the per-user totals.