Joining tables
You learned about relational data modeling practices and normalization in Chapter 1, Introduction to Data Management Systems. In relational databases, data is often normalized to be stored across multiple tables to simplify the data model and avoid redundancy. However, there are times when you want to combine data from multiple tables into one large dataset. Depending on the nature of the tables, you may want to combine the rows of them. This is called a union. Or you may want to combine the columns of multiple datasets based on a related column (or columns) between them. This is called a join.
You will learn about the fundamentals of JOIN in this section and UNION in the next section. There are three major types of joins. You will start by learning about the inner join.
Inner joins
An inner join connects rows in different tables, based on a condition known as the join predicate. In many cases, the join predicate is a logical condition of column relationships...