17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3<br />

The Foundation<br />

Statements of T-<strong>SQL</strong><br />

At last! We’ve finally disposed of the most boring stuff. It doesn’t get any worse than basic objects<br />

and tools, does it? Unfortunately, we have to lay down a foundation before we can build a house.<br />

The nice thing is that the foundation is now down. Having used the clichéd example of building a<br />

house, I’m going to turn it all upside down by talking about the things that let you enjoy living in<br />

it before we’ve even talked about the plumbing. You see, when working with databases, you have<br />

to get to know how data is going to be accessed before you can learn all that much about the best<br />

ways to store it.<br />

In this chapter, we will discuss the most fundamental Transact-<strong>SQL</strong> (T-<strong>SQL</strong>) statements. T-<strong>SQL</strong> is<br />

<strong>SQL</strong> <strong>Server</strong>’s own dialect of Structured Query Language (<strong>SQL</strong>). The T-<strong>SQL</strong> statements that we will<br />

learn in this chapter are:<br />

❑ SELECT<br />

❑ INSERT<br />

❑ UPDATE<br />

❑ DELETE<br />

These four statements are the bread and butter of T-<strong>SQL</strong>. We’ll learn plenty of other statements as<br />

we go along, but these statements make up the basis of T-<strong>SQL</strong>’s Data Manipulation Language (DML).<br />

Because you’ll generally issue far more commands meant to manipulate (that is, read and modify)<br />

data than other types of commands (such as those to grant user rights or create a table), you’ll find<br />

that these will become like old friends in no time at all.<br />

In addition, <strong>SQL</strong> provides many operators and keywords that help refine your queries. We’ll learn<br />

some of the most common of these in this chapter.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!