NTILE for Quartile Bucketing

Hard
window-functions Stripe Airbnb Two Sigma

Write a query using NTILE(4) to divide employees into salary quartiles. Return name, salary, and quartile, ordered by salary DESC.

Expected Output: Employees assigned to salary quartiles 1-4.

Tables

Hints (3 available)

SQL Editor

Output

Click "Run" to see results...