ORDER BY explained
Remember lining up for attendance as a kid in elementary school?
Let's say we've got the following students in a classroom…
…and that we need them to line up for attendance in alphabetical order.
So, they scramble around until they finally get into proper order.
This is exactly what ORDER BY statements do.
ORDER BY statements are used to sort results based on a field or aggregate function.
How to code an ORDER BY
Here's the template for an ORDER BY statement: