What order are rows selected from a table?


#1

Question

In the context of this exercise, what order are rows selected from a table?

Answer

In most SQL databases, by default, the rows will be selected in the order that they appear in the table, from top to bottom. For instance, if you have a statement like
SELECT * FROM table this will select all rows from the table from the first row that appears down to the bottom row.

Later on in the other SQL lessons, you will also learn about clauses such as ORDER BY, which allow you to set a certain order for how the rows will be returned in the result set.