247
Chapter 9: Merging Data with Joins, Subqueries, and CTEs
9
Summary
Merging data is the heart of SQL, and it shows in the depth of relational algebra as well
as the power and fl exibility of SQL. From natural joins to exotic joins, SQL is excellent at
selecting sets of data from multiple sources.
The challenge for the SQL Server database developer is to master the theory of relational
algebra and the many T-SQL techniques to effectively manipulate the data.
Manipulating data with SELECT is one of the core benefi ts of SQL Server. Although joins are
the most natural method to work with relational data, subqueries are an effective tool for
manipulating and querying data as well.
This chapter established the foundation for working with SQL, covering the SELECT state-
ment, expressions, joins, unions, subqueries, and CTEs.
c09.indd 247c09.indd 247 7/30/2012 4:25:11 PM7/30/2012 4:25:11 PM
http://www.it-ebooks.info