In
database theory
Database theory encapsulates a broad range of topics related to the study and research of the theoretical realm of databases and database management systems.
Theoretical aspects of data management include, among other areas, the foundations of q ...
, a join dependency is a constraint on the set of legal relations over a database scheme. A table
is subject to a join
dependency if
can always be recreated by
joining Join may refer to:
* Join (law), to include additional counts or additional defendants on an indictment
*In mathematics:
** Join (mathematics), a least upper bound of sets orders in lattice theory
** Join (topology), an operation combining two topo ...
multiple tables each having a subset of the attributes of
. If one of the tables in the join has all the attributes of the table
, the join dependency is called trivial.
The join dependency plays an important role in the
Fifth normal form Fifth normal form (5NF), also known as projection–join normal form (PJ/NF), is a level of database normalization designed to remove redundancy in relational databases recording multi-valued facts by isolating semantically related multiple relatio ...
, also known as ''project-join normal form'', because it can be proven that if a scheme
is decomposed in tables
to
, the decomposition will be a
lossless-join decomposition
In database design, a lossless join decomposition is a decomposition of a relation R into relations R_1, R_2 such that a natural join of the two smaller relations yields back the original relation. This is central in removing redundancy safely fr ...
if the legal relations on
are restricted to a join dependency on
called
.
Another way to describe a join dependency is to say that the relationships in the join dependency are independent of each other.
Unlike in the case of
functional dependencies, there is no
sound
In physics, sound is a vibration that propagates as an acoustic wave, through a transmission medium such as a gas, liquid or solid.
In human physiology and psychology, sound is the ''reception'' of such waves and their ''perception'' b ...
and
complete
Complete may refer to:
Logic
* Completeness (logic)
* Completeness of a theory, the property of a theory that every formula in the theory's language or its negation is provable
Mathematics
* The completeness of the real numbers, which implies t ...
axiomatization for join dependencies, though axiomatization exist for more expressive dependency languages such as
full typed dependencies.
However, implication of join dependencies is decidable.
Formal definition
Let
be a relation schema and let
be a decomposition of
.
The relation
''satisfies'' the join dependency
:
if
A join dependency is trivial if one of the
is
itself.
2-ary join dependencies are called
multivalued dependency In database theory, a multivalued dependency is a full constraint between two sets of attributes in a relation.
In contrast to the functional dependency, the multivalued dependency requires that certain tuples be present in a relation. Therefore, ...
as a historical artifact of the fact that they were studied before the general case. More specifically if ''U'' is a set of attributes and ''R'' a relation over it, then ''R'' satisfies
if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (shortened as "iff") is a biconditional logical connective between statements, where either both statements are true or both are false.
The connective is b ...
''R'' satisfies
Example
Given a pizza-chain that models purchases in table Order = .
The following relations can be derived:
* customer-name depends on order-number
* pizza-name depends on order-number
* courier depends on order-number
Since the relationships are independent there is a join dependency as follows: *((order-number, customer-name), (order-number, pizza-name), (order-number, courier)).
If each customer has his own courier however, there can be a join-dependency like this: *((order-number, customer-name), (order-number, pizza-name), (order-number, courier), (customer-name, courier)),
but *((order-number, customer-name, courier), (order-number, pizza-name)) would be valid as well. This makes it obvious that just having a join dependency is not enough to normalize a database scheme.
See also
*
Chase (algorithm) The chase is a simple fixed-point algorithm testing and enforcing implication of data dependencies in database systems. It plays important roles in database theory as well as in practice.
It is used, directly or indirectly, on an everyday basis by ...
*
Universal relation assumption
References
{{Database normalization
Database normalization