That's correct! The last function we'll introduce in this section is
NTILE(X). It distributes the rows into a specific number of groups, provided as X. For instance:
NTILE(3) OVER (ORDER BY editor_rating DESC)
In the above example, we create three groups with
NTILE(3) that are divided based on the values in the column
editor_rating. The "best" games will be put in group 1, "average" games in group 2, "worst" games in group 3. See the picture below:
Note that if the number of rows is not divisible by the number of groups, some groups will have one more element than other groups, with larger groups coming first.