Segment customers into four tiers by total spend. Return name, total_spent and quartile (1 = biggest spenders) using NTILE(4) over customers who have ordered, ordered by total spend descending with ties by name. Sort the output by quartile, then name.
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial