thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Advanced

NTILE Function

A window function that divides ordered rows into a specified number of roughly equal buckets and returns each row's bucket number.

Definition

NTILE(4) assigns quartiles and NTILE(10) deciles. When rows do not divide evenly, the earlier buckets get one extra row. It is used for customer segmentation such as RFM scoring.

Example

NTILE(4) OVER (ORDER BY TotalSpend DESC) AS SpendQuartile

Exam tip

NTILE buckets by row count, not by value thresholds; equal values can land in different buckets.

Related terms