Menu
Coddy logo textTech

ORDER BY criterion

Lesson 4 of 13 in Coddy's SQL for advanced course.

One of the OVER () options are the ORDER BY

For example:

ROW_NUMBER() OVER (ORDER BY year DESC) as row_num

This will generate a column that will number the rows following the descending year order.

challenge icon

Challenge

Easy

Fetch all plants with a hue greater than 0.34 and add two numbering columns:

row_num_hue that will number the rows according to hue in ascending order

row_num_score that will number the rows by the following formula: (rough*hue) / hue in descending order

Order the result by the plant id in ascending order

Try it yourself

All lessons in SQL for advanced