SpinTheMic
Pro

Explain it in 60 seconds

Percentiles and NTILE

Data Engineering · SQL · Intermediate

How do you compute medians, percentiles and buckets in SQL?

What a strong answer covers

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

  • PERCENTILE_CONT gives an interpolated percentile, PERCENTILE_DISC an actual value.
  • MEDIAN exists in some engines like Snowflake.
  • APPROX_PERCENTILE is faster on huge data.
  • NTILE(n) splits ordered rows into n roughly equal buckets.
  • Used for things like customer value deciles.
Practise this topic

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

See all topics