Interview practice question
Median delivery time by city
Data Analyst · SQL for Analytics · Intermediate
How do you calculate median delivery time per city in SQL?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY ...).
- Or MEDIAN() / APPROX_QUANTILES depending on DB.
- Compute duration first.
- Exclude invalid/negative times.
- Also show p90.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.