Inference Rules in DBMS



Functional Dependency is one of the fundamental concepts in DBMS and we apply this concept in Database Designing. One must understand the rules and properties of functional dependency to design efficient and normalized databases.

Functional Dependencies describe how attributes determine one another and ensure that we correctly interpret relationships within a table. In this chapter, we will explain in detail the properties of functional dependencies, which are also known as Armb axioms. We will also take a look at the inference rules derived from the Armb axioms.

Basics of Functional Dependency

First, let's have a basic recap of functional dependency. In simple terms, if attribute X can be used to uniquely identify attribute Y, we say that "X determines Y". We can also say that "Y is functionally dependent on X". This is denoted as "X → Y".

For example, consider a table where −

  • X is a roll number, and
  • Y includes student details like name, department, and building.

If each roll number is uniquely identifies a student and their associated details, we can say "Roll Number → Student Details". Here, Roll Number is the determinant, and Student Details is the dependent.

Armb Axioms: Properties of Functional Dependency

Let us now understand the properties for functional dependencies.

The Reflexivity Property

The reflexivity property states that if A is a set of attributes, and B is a subset of A, then A → B is a valid functional dependency. It means an attribute set can always determine its subset.

Example − Consider a table with attributes A = {Name, Age, ID}. If we take B = {ID}, which is a subset of A, then A → B is a functional dependency.

If we know Name, Age, and ID, we can obviously identify the ID. This is why reflexivity is considered a fundamental rule.

The Augmentation Property

The augmentation property is about adding additional attributes to both sides of a dependency. If A → B is a valid functional dependency. By adding any set of attributes C to both A and B will still preserve the dependency.

Example − Let us say "Roll Number → Department" is a functional dependency. If we augment this by adding Class to both sides, we get "Roll Number, Class → Department, Class". This new dependency is also valid.

The augmentation rule emphasizes that adding more context does not change the relationship already established by A → B.

The Transitivity Property

The transitivity property is perhaps the most intuitive. If A → B and B → C, then A → C must also hold true.

Example − Let us consider the following –

  • Roll Number → Student NameRoll
  • Student Name → Department

By transitivity, we can conclude that Roll Number → Department.

It is like saying: If knowing Roll Number helps us to figure out Student Name. And knowing Student Name helps us to find Department. Then knowing Roll Number determines Department.

Inference Rules Derived from Armb Axioms

In addition to the three core axioms, there are several inference rules or secondary rules. This is derived from Armb axioms. These rules help simplify or combine dependencies.

The Union Rule

The union rule states that if A → B and A → C, then A → BC. In other words, if A can determine B and A can determine C, then A can determine both B and C together.

Example − If Roll Number → Student Name and Roll Number → Department, we can combine these into a single dependency: Roll Number → Student Name, Department.

Union simplifies the representation of dependencies by merging them.

The Composition Rule

The composition rule is another extension on the union rule. It states that if A → B and C → D, then AC → BD. Essentially, we combine determinants and dependents from two dependencies.

Example: Consider, Roll Number → Student Name. Class → Teacher. By composition, we can say Roll Number, Class → Student Name, Teacher.

The Decomposition Rule

The decomposition rule is the opposite of union. If A → BC, we can break it down into A → B and A → C.

Example − If Roll Number → Student Name, Department, we can decompose this into −

  • Roll Number → Student Name
  • Roll Number → Department

Decomposition is helpful for simplifying complex dependencies.

The Pseudo-Transitivity Rule

The pseudo-transitivity rule is a variation of transitivity. If A → B and BC → D, then AC → D.

Example − Consider Roll Number → Class. Class, Teacher → Subject.

Using pseudo-transitivity, we can conclude that Roll Number, Teacher → Subject.

This rule shows how to combine dependencies even when the second dependency has multiple determinants.

Importance of Inference Rules

These properties and rules help database designers validate and manipulate functional dependencies effectively. They allow us to −

  • Simplify dependencies by combining or breaking them down.
  • Check for redundancies in relationships between attributes.
  • Normalize databases, ensuring efficiency and reducing anomalies like update, insert, or delete issues.

Conclusion

In this chapter, we covered the core rules of functional dependency and how they help structure database relationships. We started with the Armb axioms (reflexivity, augmentation, and transitivity) and understood their role in defining dependencies. Thereafter, we explored inference rules like union, composition, decomposition, and pseudo-transitivity. Functional dependencies are not just abstract concepts; they are practical tools for creating efficient and reliable databases.

Advertisements