O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Joins

A query that extracts data from more than one table must perform a join. In the following sections, I’ll explain the different types of joins (Table 7.1), why they’re used, and how to create SELECT statements that use them.

The important characteristics of joins are:

  • The two join operands (input tables) usually are called the first table and the second table, but they are called the left table and the right table in outer joins, in which table order matters.

  • The tables always are joined row by row and side by side by satisfying whatever join condition(s) you specify in the query.

  • Rows that don’t match may be included or excluded, depending on the type of join.

  • Values in joined columns usually are compared for equality (=), but you also ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required