Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Simple OVER()
PARTITION BY
Ranking functions
Window Frames
Analytic Functions
PARTITION BY ORDER BY
Order of Evaluation
30. Grouping by NTILE
Finished!

Instruction

Exactly right! Are you ready to take on the final question?

Exercise

Divide subscriptions into three groups (buckets) based on the PaymentAmount. Group the rows in the Subscription table based on those buckets. Show the following information: the Bucket, the minimal PaymentAmount in that bucket (column MinPaymentAmount) and the maximal PaymentAmount in that bucket (column MaxPaymentAmount).

Stuck? Here's a hint!

Use NTILE(3) in a subquery and rename it Bucket. In the outer query, use it to group the rows.