Inclusion Dependency in DBMS
In database design, inclusion dependency (IND) signifies a constraint where values in one column or set must be a subset of values in another column or set. Although less common than functional or join dependencies, IND, exemplified by foreign keys, influences database structure. Essentially, IND ensures relational consistency within a database management system by linking specific column values to others.
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:
teacher_id (primary key) | name | department |
---|---|---|
1 | Ram Kumar | DBMS |
student:
student_1 | name | teached_id (foreign key) | age |
---|---|---|---|
1 | Rahul Singh | 1 | 18 |
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:
Axiom | Formal Expression |
---|---|
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.
Conclusion
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