db.l3.ai

Play

lessons

what-changed-in-19

editor

engine: not started

results

Run a query to see rows here.

check

ntile

ntile(n) cuts the ordered rows into n nearly equal buckets.

task

Split customers who ordered into 4 spend quartiles (spend = sum of unit_cents * qty, ties by customer_id, lowest spend is quartile 1). Return the quartile of customer 10.

hints