From the course: Microsoft SQL Server 2016: Query Data

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Understanding order

Understanding order

- [Instructor] In this lesson, we'll take a look at the concept of ordering results in a query. In our next lesson, we'll go into the actual implementation of ordering records, but this lesson will focus on an understanding of how data is not ordered in a database, nor are they ordered by default in the results that are returned from a query. Then we'll discuss the concept of ordering from a SQL perspective. So before we begin, let's review the concept of relation once again, as introduced in our first video lesson on relational theory. SQL Server uses the table to represent the concept of a relation. We also learn that a relation is considered to be a set, and in mathematical terms, a set has no order defined for the elements contained in that set. As a result, the SQL Server table also has no defined order for the records found within it. We'll show you a quick sample here. We're going to run a query against the person table in our SQL server database and we'll take a look at the…

Contents