Join (SQL)

joinjoinsInner joinouter joinCross joinjoin algorithmjoinedjoiningquerytable joins
An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database.wikipedia
114 Related Articles

Hash join

Actual SQL implementations normally use other approaches, such as hash joins or sort-merge joins, since computing the Cartesian product is slower and would often require a prohibitively large amount of memory to store.
The hash join is an example of a join algorithm and is used in the implementation of a relational database management system.

Sort-merge join

merge join
Actual SQL implementations normally use other approaches, such as hash joins or sort-merge joins, since computing the Cartesian product is slower and would often require a prohibitively large amount of memory to store.
The sort-merge join (also known as merge join) is a join algorithm and is used in the implementation of a relational database management system.

Null (SQL)

NULL NULLs
When the join-predicate is satisfied by matching non-NULL values, column values for each matched pair of rows of A and B are combined into a result row.
Null has been the focus of controversy and a source of debate because of its associated three-valued logic (3VL), special requirements for its use in SQL joins, and the special handling required by aggregate functions and SQL grouping operators.

Cartesian product

productCartesian squareCartesian power
CROSS JOIN returns the Cartesian product of rows from tables in the join.

Microsoft SQL Server

SQL ServerMS SQLMS SQL Server
Sybase supports the syntax (Microsoft SQL Server deprecated this syntax since version 2000):
For example, for a query that contains a join statement and a select statement, executing join on both the tables and then executing select on the results would give the same result as selecting from each table and then executing the join, but result in different execution plans.

Query optimization

query optimizeroptimizationQuery processing
A query optimizer determines how to execute a query containing joins.
Most query optimizers determine join order via a dynamic programming algorithm pioneered by IBM's System R database project.

Composition of relations

compositionrelation compositionrelative product
This can also be used to define composition of relations.
For example, in the query language SQL there is the operation Join (SQL).

View (SQL)

viewviewsdatabase view
As a special case, a table (base table, view, or joined table) can to itself in a self-join.

Alias (SQL)

aliases
Also, if only one table is being selected and the query is not using table joins, it is permissible to omit the table name or table alias from the column name in the SELECT statement.

Set operations (SQL)

unionEXCEPTINTERSECT
The discussion of full outer joins also has an example that uses.

SQL

Structured Query LanguageSQL databaseSQL Databases
An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database.

Column (database)

columnscolumnAttribute
An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database. In the following tables the column of the table (which can be designated as ) is the primary key, while is a foreign key.

Table (database)

tabletablesdatabase table
An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database.

Database

database management systemdatabasesDBMS
An SQL join clause - corresponding to a join operation in relational algebra - combines columns from one or more tables in a relational database.

American National Standards Institute

ANSIAmerican Standards AssociationAmerican National Standard
ANSI-standard SQL specifies five types of :,,, and.

Database normalization

normalizationnormalizednormal form
Relational databases are usually normalized to eliminate duplication of information such as when entity types have one-to-many relationships.

Primary key

Alternate keydefining database keykey
In the following tables the column of the table (which can be designated as ) is the primary key, while is a foreign key.

Foreign key

Foreignforeign key constraintforeign key references
In the following tables the column of the table (which can be designated as ) is the primary key, while is a foreign key.

Where (SQL)

WHERELIKEWHERE clause
The results of a cross join can be filtered by using a clause which may then produce the equivalent of an inner join.

SQL:2011

SQL:2011-14
In the SQL:2011 standard, cross joins are part of the optional F401, "Extended joined table", package.

Application software

applicationapplicationssoftware application
An inner join requires each row in the two joined tables to have matching column values, and is a commonly used join operation in applications but should not be assumed to be the best choice in all situations.

Query plan

Execution planaccess planexecution
Thus the result of the execution of the query above will be:

Referential integrity

Declarative Referential Integrityreferential integrity constraintforeign-key candidates
The Inner join can only be safely used in a database that enforces referential integrity or where the join columns are guaranteed not to be NULL.

Transaction processing

transactiontransactionstransaction manager
Many transaction processing relational databases rely on Atomicity, Consistency, Isolation, Durability (ACID) data update standards to ensure data integrity, making inner joins an appropriate choice.

ACID

ACID transactionsAtomicity, Consistency, Isolation, DurabilityACID properties
Many transaction processing relational databases rely on Atomicity, Consistency, Isolation, Durability (ACID) data update standards to ensure data integrity, making inner joins an appropriate choice.