Inclusion Dependency in DBMS
Inclusion dependencies are generalized form of referential constraints and are used to guide the design of the database, however, they usually have little influence on how the database is actually designed. Inclusion dependency is widespread but less prevalent than functional dependency, join dependency and multivalued dependency.
A statement in which some columns of any relation are contained in other columns is known as an Inclusion Dependency. Inclusion dependencies, like functional dependencies, represent one-to-many relationships. However, inclusion dependencies are more commonly used to represent relationships between relations. A foreign key is an example of inclusion dependency. The relation which it is referring is contained in the column of primary key.
Inclusion Dependency Example
Let's say we take two relations, namely R and S that are created by using two entity sets in a way that every entity in R is also S entity. Inclusion dependence occurs when projecting R's key attributes gives a relation that is contained in the relation acquired by projecting S's key attributes.
Let's name the relations R as teacher and S as student, so take the attribute as teacher_id, so we can write:
- teacher.teacher_id --> student.teacher_id
|teacher_id (primary key)||name||department|
|student_1||name||teached_id (foreign key)||age|
teacher_id will be the primary key for teacher table and will be foreign key for the student table, attributes of the teacher table will be available in the student table.
So this foreign key concept makes the inclusion dependency possible.
Inference Axioms for Inclusion Dependencies
Interference axioms for inclusion dependencies are described in the following table:
|Reflexive rule||A -> A|
|Projection and Permutation rule||IF AB -> CD THEN A -> C AND B -> D|
|Transitivity rule||IF A -> B AND B -> C THEN A -> C|
- Reflexive rule here states that a table can have attributes and can project on itself: If X⊇X then X->X.
- Projection and Permutation rule here states that if IF AB->CD then A->C AND B->D.
- Transitivity rule here states that if a table A projects to B and B projects to C, so We can conclude A->C.
Now that we have seen an example of inclusion dependency in DBMS, let us note down a few points:
- Inclusion dependency can be used to guide the design of the database.
- A statement in which some columns of a relation are contained in other columns is known as an inclusion dependency.
- A foreign key is an example of inclusion dependency. The referring relation is contained in the primary key column.
- They follow some rules:
- Reflexive rule: A -> A
- Projection and Permutation rule: IF AB -> CD THEN A -> C AND B -> D
- Transitivity rule: IF A -> B AND B -> C THEN A -> C