Top Half of Spenders
Medium
Customer Segmentation (RFM)
Split customers into two equal groups by total spend (group 1 = higher spenders) using NTILE. Return customer, total spend and group, ordered by spend descending.
Table schema
Orders(id INT PRIMARY KEY, customer VARCHAR(10), amount INT)Sample data
id | customer | amount
1 | Ann | 350
2 | Bob | 90
3 | Cy | 220
4 | Dee | 500
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.