Quartile Buckets with NTILE
Medium
Ranking Edge Cases
Split students into 4 equal-sized buckets by score descending (bucket 1 = best). Return name, score and bucket, ordered by score descending then name.
Table schema
Scores(name VARCHAR(10), score INT)Sample data
name | score
A | 95
B | 90
C | 85
D | 80
E | 75
F | 70
G | 65
H | 60
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.