SQL - Window Functions Fundamentals
Given the table sales with amount values: 10, 20, 30, 40, 50, what is the ntile(3) value for the row with amount = 40 when ordered by amount?
SELECT amount, NTILE(3) OVER (ORDER BY amount) AS tile FROM sales;
