Percentile Rank of Order Values

Hard
window-functions Stripe Google Meta

Compute the PERCENT_RANK() of each order by amount. Return order_id, amount, and pct_rank (rounded to 2 decimal places), ordered by amount ascending.

Expected Output: Each order with its percentile rank (0 to 1).

Tables

Hints (3 available)

SQL Editor

Output

Click "Run" to see results...