SpinTheMic
Pro

Interview practice question

Median order value per country

Data Engineering · SQL · Intermediate

Calculate the median order value per country.

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Use PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY amount) grouped by country.
  • Or MEDIAN() in Snowflake.
  • Without percentile functions, use ROW_NUMBER and COUNT to find the middle.
  • Approximate percentile for huge data.
  • Median is more robust than average with outliers.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics