Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
8.02 Join a Table to Itself by Using a Self-Join
8.03 Generate a Cartesian Product of All Rows from Two or More Tables
This chapter reviews various types of joins. A join is a SELECT statement that retrieves data from two or more tables and connects that data together to produce a combined set of output. The SELECT statement specifies data in one table that is identical to data in another table. Tables that share common data elements that support joins are said to be “related” to each other. This is why a SQL database is called a “relational database management system”; joining tables is the whole purpose of SQL database systems.