From the course: SQL Server 2008 Essential Training

Unlock the full course today

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

Using SELECT statements

Using SELECT statements - SQL Server Tutorial

From the course: SQL Server 2008 Essential Training

Start my 1-month free trial

Using SELECT statements

Let's begin by going through some simple SQL to read or retrieve information from our database. I am going to open up SQL Server Management Studio and connect to my instance here. After it's open, the button that I am going to click is this one, the New Query button on the toolbar. A query, well, that's the Q in SQL. It's Structured Query Language. We write queries and this one will use the most common piece of SQL, the SELECT statement. We are selecting or choosing information from one of the tables in one of our databases. So I am going to write this phrase to begin with SELECT *, using the asterisk, From. I want to get everything from somewhere. Well, there's the question. Which database? Which table? Because in SQL Server Management Studio I can see that I have got quite a few databases, even the system databases. And I could be writing a select statement that goes against any of them. So I am first going to have to say which database I'm coming from. So I'm going to say I want to…

Contents