Day 5. Joining Tables

In the past several lessons, you might have noticed that the data you have been accessing has been from only one table at a time. You have been looking at order information, but the order is missing things such as the customer name and product number. The strength of a relational database is to be able to access more than one table at a time. Relational database systems get their name from the relationships that are defined between tables. Because most real data is spread out across several tables, you will see how to join tables together.

Table joins are the topic of the day. Understanding joins is central to your understanding of T-SQL, so today's lesson is as important a topic as you can find in this book. The discussions include

  • Understanding Joins

  • T-SQL syntax for Joins

  • Primary and foreign keys

  • Understanding cross joins

  • Joining multiple tables

  • Displaying data from multiple tables

A query that includes data from multiple tables requires you to join those tables together. You specify the names of the tables in the SELECT statement and the method of relating them. The server then performs the join by comparing the join data from each table and returns the final result set back to you.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset