Home > Articles > Data > SQL

  • Print
  • + Share This
This chapter is from the book

Summary

You have been introduced to one of the most robust features of SQL—the table join. Imagine the limits if you were not able to extract data from more than one table in a single query. You were shown several types of joins, each serving its own purpose depending on conditions placed on the query. Joins are used to link data from tables based on equality and non-equality. OUTER JOINs are very powerful, allowing data retrieved from one table, even though associated data is not found in a joined table. SELF JOINs are used to join a table to itself. Beware of the cross join, more commonly known as the Cartesian product. The Cartesian product is the result set of a multiple table query without a join, often yielding a large amount of unwanted output. When selecting data from more than one table, be sure to properly join the tables according to the related columns (normally primary keys). Failure to properly join tables could result in incomplete or inaccurate output.

  • + Share This
  • 🔖 Save To Your Account