Join dependency explained

In database theory, a join dependency is a constraint on the set of legal relations over a database scheme. A table

T

is subject to a join dependency if

T

can always be recreated by joining multiple tables each having a subset of the attributes of

T

. If one of the tables in the join has all the attributes of the table

T

, the join dependency is called trivial.

The join dependency plays an important role in the fifth normal form (5NF), also known as project-join normal form, because it can be proven that if a scheme

R

is decomposed in tables

R1

to

Rn

, the decomposition will be a lossless-join decomposition if the legal relations on

R

are restricted to a join dependency on

R

called

*(R1,R2,\ldots,Rn)

.

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 and complete axiomatization for join dependencies,[1] though axiomatization exist for more expressive dependency languages such as full typed dependencies.[2] However, implication of join dependencies is decidable.

Formal definition

Let

R

be a relation schema and let

R1,R2,\ldots,Rn

be a decomposition of

R

.

The relation

r(R)

satisfies the join dependency

*(R1,R2,\ldots,Rn)

if
n
\bowtie
i=1
\Pi
Ri

(r)=r.

A join dependency is trivial if one of the

Ri

is

R

itself.[3]

2-ary join dependencies are called multivalued dependency 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

X\twoheadrightarrowY

if and only if R satisfies

*(X\cupY,X\cup(U-Y)).

Example

Given a pizza-chain that models purchases in table Order = .The following relations can be derived:

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

Notes and References

  1. S. V.. Petrov. Finite axiomatization of languages for representation of system properties. Information Sciences. 47. 339–372. 1989. 10.1016/0020-0255(89)90006-6.
  2. Book: Abiteboul. Hull. Vianu. Foundations of databases. 1995 . Addison-Wesley . 9780201537710 . registration.
  3. Book: Silberschatz, Korth. Database System Concepts. 1st.