From the course: Learning SQL Server 2017

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Create a SELECT statement

Create a SELECT statement - SQL Server Tutorial

From the course: Learning SQL Server 2017

Start my 1-month free trial

Create a SELECT statement

- [Instructor] When it's time to start retrieving information that's stored in your tables, you'll turn to an activity called querying the database. In order to query the database, you'll need to issue commands written in a language called Transact-SQL, or T-SQL if you prefer a shorter name. To get our first look at T-SQL, I'm going to drill down into a database called WideWorldImporters that we loaded in the last chapter. We'll come into the Tables folder, and I'm going to find a table here called Sales.Orders. Let's go ahead and right-click on it, and choose Select Top 1000 Rows. On the top of the query window, we have the exact syntax of the query, and down in the bottom we have the results. Let's focus on the query here at the top. It begins with the keyword SELECT. The SELECT clause tells the database what columns are going to be returned. In this case, we're returning the OrderID, the CustomerID, the SalespersonID, and all these other columns, and you can see that in the results…

Contents