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.

Chapter 4: JOINs<br />

There are two different forms of JOIN syntax available for INNER and OUTER JOINs. I provided the<br />

legacy syntax here to help you deal with legacy code, but the newer ANSI format presented through<br />

most of this chapter is highly preferable, as it is more readable, is not prone to the ambiguities of the<br />

older syntax, and will be supported in <strong>SQL</strong> <strong>Server</strong> for the indefinite future.<br />

Over the course of the next few chapters, we will be learning how to build our own tables and relate<br />

them to each other. As we do this, the concepts of what columns to join on will become even clearer.<br />

Exercises<br />

1. Write a query against the AdventureWorks<strong>2008</strong> database that returns one column called Name<br />

and contains the last name of the employee with NationalIDNumber 112457891.<br />

112

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

Saved successfully!

Ooh no, something went wrong!