Freigeben über


Querying multiple tables by using joins in Transact-SQL

In Skill 1.2 from Exam Ref 70-761 Querying Data with Transact-SQL , learn how to query multiple tables by using join statements based on provided tables, data, and requirements.


Skill 1.2: Query multiple tables by using joins

Often, data that you need to query is spread across multiple tables. The tables are usually related through keys, such as a foreign key in one side and a primary key in the other. Then you can use joins to query the data from the different tables and match the rows that need to be related. This section covers the different types of joins that T-SQL supports: cross, inner, and outer.

This section covers how to:

  • Write queries with join statements based on provided tables, data, and requirements
  • Determine proper usage of INNER JOIN, LEFT/RIGHT/FULL OUTER JOIN, and CROSS JOIN
  • Construct multiple JOIN operators using AND and OR
  • Determine the correct results when presented with multi-table SELECT statements and source data
  • Write queries with NULLs on joins

Read this sample chapter.