Join in a relational database management program is a data retrieval operation in which a new data table is built from data in two or more existing data tables. The join operation for relational databases is otherwise known as a natural join, and this type of join is characterized by two relations that are connected with their common attributes.
In SQL, an INNER JOIN prevents a Cartesian product from occurring when there are two tables in a query. For each table added to a SQL Query, one additional INNER JOIN is added to prevent a Cartesian product. Thus, for N tables in an SQL query, there must be N−1 INNER JOINS to avoid a Cartesian product.