By the end of this chapter you'll be able to…

  • 1State Armstrong's axioms and the three derived rules, and know that decomposition applies only to right sides
  • 2Compute attribute closure and use it to test for superkeys
  • 3Find all candidate keys using the never-on-right and never-on-left shortcuts
  • 4Compute a canonical cover and explain why it is not unique
  • 5Name the three anomalies and connect each to a non-key determinant
  • 6Decide whether a relation is in 2NF, 3NF or BCNF and justify the answer dependency by dependency
  • 7Apply the binary lossless-join test and produce a counterexample for a lossy decomposition
  • 8Test a decomposition for dependency preservation
  • 9Explain why BCNF can conflict with dependency preservation while 3NF cannot
  • 10Recognise a multivalued dependency and decompose to 4NF
💡
Why this chapter matters in GATE
Every update anomaly traces to a functional dependency whose determinant is not a key, so the normal forms are one idea applied with increasing strictness rather than a list to memorise. GATE asks for candidate keys, the highest normal form of a given relation, lossless-join and dependency-preservation tests, and canonical covers.

Before you start — revise these

🔗
The relational model: relations, keys, superkeys and foreign keys
🔗
Natural join, and the idea of a spurious tuple
🔗
Basic set containment notation

Integrity Constraints & Normal Forms

Normalisation looks like a list of rules to memorise, and understanding why it is not saves a great deal of effort.

The organising fact is that every update anomaly traces to a functional dependency whose determinant is not a key. If a non-key attribute determines something, that something is stored redundantly, once per row sharing the determinant, and the copies can disagree.

Each normal form is therefore a statement about which dependencies are permitted to exist, and the forms get stronger by permitting fewer of them. Boyce-Codd normal form is the limiting case: every determinant must be a superkey.

The second organising fact is that decomposition must not lose information, and the test for that is purely mechanical. A binary decomposition is lossless exactly when the shared attributes determine one of the two halves.

The third is a trade-off that cannot be escaped. Third normal form is always achievable with both losslessness and dependency preservation. Boyce-Codd normal form is always achievable losslessly, but sometimes only by giving up a dependency.

1. Functional Dependencies

A functional dependency says that any two tuples agreeing on must agree on .

It is a statement about every legal instance, not about the rows currently present. A dependency that happens to hold in the sample data is not necessarily a dependency of the schema.

A trivial dependency has contained in and holds automatically.

Armstrong's axioms are sound and complete, meaning they derive exactly the dependencies logically implied by a given set.

Reflexivity: if then .

Augmentation: if then .

Transitivity: if and then .

Three derived rules save time. Union combines and into . Decomposition splits into and . Pseudotransitivity turns and into .

Decomposition applies only to the right side. From one may not conclude , and assuming otherwise is the single most common error in this topic.

2. Attribute Closure and Candidate Keys

The closure is the set of all attributes functionally determined by .

The algorithm is simple. Start with . Repeatedly, if some dependency's left side is contained in the current set, add its right side. Stop when nothing changes.

is a superkey exactly when contains every attribute of the relation.

Finding candidate keys uses two shortcuts that turn a search into an inspection.

Any attribute appearing on no right side must belong to every candidate key, because nothing else can determine it.

Any attribute appearing on no left side and on some right side belongs to no candidate key, because it determines nothing.

The procedure is therefore: collect the attributes that must be in every key, take their closure, and if that is everything, it is the unique candidate key. Otherwise extend it with one attribute at a time from the remaining pool.

A prime attribute is one belonging to some candidate key. Non-prime attributes are the ones normalisation is mostly about.

3. Canonical Cover

A canonical cover is a minimal set of dependencies equivalent to the original.

Three conditions define it. Every right side is a single attribute. No dependency is redundant, meaning removing it changes the closure of nothing. No left side has a redundant attribute.

The computation proceeds in that order. Split all right sides. Then, for each dependency, test whether its left side still determines its right side without it. Then, for each left side attribute, test whether it can be dropped.

Order matters and the result is not unique, so different valid canonical covers exist for the same set, and an exam answer is judged on the checks rather than on matching a particular list.

The canonical cover is what the 3NF synthesis algorithm consumes, which is why it is worth computing correctly.

4. Anomalies and the Normal Forms

Three anomalies motivate the whole subject.

Insertion anomaly: a fact cannot be recorded because another, unrelated fact is unknown.

Deletion anomaly: removing one fact silently removes another.

Update anomaly: a fact stored in many rows must be changed in all of them, and a partial update leaves the database inconsistent.

First normal form requires atomic attribute values, with no repeating groups or nested relations. It is a condition on the data model rather than on dependencies.

Second normal form forbids a partial dependency, meaning a non-prime attribute determined by a proper subset of some candidate key. It matters only when a candidate key is composite.

Third normal form requires that for every non-trivial dependency , either is a superkey or is prime.

The second clause is what makes 3NF weaker than BCNF, and it exists precisely so that dependency preservation is always achievable.

Boyce-Codd normal form requires that for every non-trivial dependency , is a superkey. There is no escape clause.

A relation with only two attributes is always in BCNF, which is a useful sanity check.

5. Decomposition

A decomposition is lossless if joining the pieces recovers exactly the original relation, with no spurious tuples.

For a binary decomposition into and , the test is that or .

In words: the shared attributes must be a key of at least one piece.

Dependency preservation asks whether every original dependency can be checked on a single piece, without a join.

The union of the projected dependency sets must be equivalent to the original set, which is tested by checking each original dependency against the closure computed from the union.

Losing a dependency is not a correctness failure but an enforcement cost. The constraint still holds logically; it simply cannot be verified without joining, which is expensive enough that systems typically stop enforcing it.

The 3NF synthesis algorithm builds one relation per dependency in the canonical cover, adds a relation containing a candidate key if none of the pieces contains one, and removes any relation contained in another. It guarantees 3NF, losslessness and dependency preservation together.

BCNF decomposition is analytical rather than synthetic. Find a violating dependency , split the relation into and plus the remaining attributes, and repeat. It guarantees losslessness but not preservation.

6. Multivalued Dependencies and 4NF

A multivalued dependency, written double-arrow , says that the set of values associated with an value is independent of the remaining attributes.

It captures redundancy that no functional dependency can. A relation recording a course's instructors and its textbooks, where any instructor may use any textbook, must store every instructor-textbook pair, and no functional dependency is violated.

Every functional dependency is a multivalued dependency, but not conversely.

Fourth normal form requires that for every non-trivial multivalued dependency double-arrow , is a superkey.

The fix is the same shape as before: split the relation so each independent set lives with its determinant.

Fifth normal form, or project-join normal form, handles join dependencies that only a decomposition into three or more pieces resolves, and appears rarely in examinations.

Constraints the Schema Enforces Directly

Normalisation removes redundancy; declared constraints enforce validity, and the two are separate concerns that the chapter title joins.

A domain constraint restricts an attribute's permitted values, either through its declared type or through a CHECK clause on the column.

A key constraint declares uniqueness, and a primary key adds the prohibition on nulls that entity integrity requires.

A referential constraint declares a foreign key and specifies what happens on delete or update: cascade, set null, or restrict.

An assertion states a condition over the whole database rather than one table, and is the only declarative way to express constraints spanning relations, though few systems implement it, leaving triggers as the practical mechanism.

7. Worked Examples

Example 1. Find all candidate keys of with dependencies , , , .

First classify the attributes.

Right sides contain , , , and . Every attribute appears on some right side, so no attribute is forced into every key by that test.

Left sides contain , , , and , so every attribute appears on some left side too, and none is excluded.

Both shortcuts fail, so compute closures of single attributes.

: start with ; add from ; add from ; now is present so add . The closure is , so is a candidate key.

: , then from . That is only, so is not a key.

: , then from , then everything gives. The closure is , so is a candidate key.

is just and is just .

Now try pairs involving , and .

: , add , then , then . That is everything, so is a candidate key.

: , add from , now gives , then . Everything, so is a candidate key.

is only. Not a key.

Check minimality: and are both minimal since no single attribute among them is a key.

The candidate keys are , , and , and the prime attributes are , , , and , which is all of them.

Example 2. Determine the highest normal form of that relation.

Every attribute is prime, which was the conclusion above.

Check 3NF. The condition is that for each dependency , either is a superkey or is prime.

: is a candidate key, so this passes on the first clause.

: is a candidate key, passes.

: is a candidate key, passes.

: is not a superkey, since is only . But is prime, being part of . So it passes on the second clause.

The relation is in 3NF.

Check BCNF. Every determinant must be a superkey, with no escape clause.

violates it, since is not a superkey.

So the relation is in 3NF but not BCNF, which is exactly the situation the second clause of 3NF was designed to permit.

Example 3. Test whether decomposing with and into and is lossless.

Compute the shared attributes. is empty.

The test requires the intersection to determine one of the halves. An empty set determines only attributes that everything determines, which here is nothing.

The decomposition is lossy.

A concrete counterexample makes it vivid. Suppose holds two tuples, and .

holds and . holds and .

Their natural join, with no common attribute, is a Cartesian product giving four tuples, two of which never existed.

The repair is to include a connecting attribute. Decomposing into and gives intersection , and since means determines all of , the decomposition is lossless.

Example 4. Decompose with and into BCNF, and show which dependency is lost.

First find the candidate keys.

is , so is a key. : , add from , giving , so is a key.

is , is , is . So the candidate keys are and , and the prime attributes are , and .

Check 3NF. has a superkey determinant. has a non-superkey determinant, but is prime. So the relation is in 3NF.

Check BCNF. violates it, since is , not everything.

Decompose on the violating dependency. Put and its closure together as , and keep with the remaining attributes as .

Verify losslessness. The intersection is , and means determines all of . Lossless.

Now check dependency preservation.

is checkable on alone.

is checkable on neither. lacks and lacks , so verifying it requires joining the two pieces.

The dependency is lost.

This is the standard illustration that BCNF and dependency preservation can conflict, and no other BCNF decomposition of this relation preserves it either.

The practical consequence: a system using this decomposition cannot enforce cheaply, so two rows could be inserted that jointly violate it, and only a periodic join would detect the problem. Designers often stop at 3NF for exactly this reason.

Example 5. Compute a canonical cover for , , , .

Step one: make all right sides single attributes.

This gives , , , again, and .

Removing the literal duplicate leaves , , , .

Step two: remove redundant attributes from left sides.

Consider . Is redundant? Compute using the current set: , then , then . Since contains , is redundant and the dependency becomes .

That duplicates an existing dependency, so the set is now , , .

Step three: remove redundant dependencies.

Test . Remove it and compute from : , then , then . is still reachable, so is redundant.

Remove it, leaving , .

Test . Removing it leaves only , and would be just . Not redundant, so keep it.

Test . Removing it leaves only , and would be just . Not redundant, so keep it.

The canonical cover is .

Example 6. A relation Course(cid, instructor, textbook) records that any instructor of a course may use any textbook of that course. Identify the dependency and normalise.

No functional dependency is violated. The key is all three attributes, since no attribute determines any other.

The relation is therefore in BCNF, trivially, because the only determinant is the full key.

Yet the redundancy is obvious. A course with 3 instructors and 4 textbooks needs 12 rows, and adding a fifth textbook requires 3 new rows rather than 1.

The dependency present is multivalued. Course double-arrow instructor holds, because the set of instructors for a course does not depend on which textbook the row mentions.

Course double-arrow textbook holds symmetrically, and in fact the two always come in pairs within a relation.

4NF is violated, since cid is not a superkey.

Decompose into CourseInstructor(cid, instructor) and CourseTextbook(cid, textbook).

Now the course needs 3 plus 4, which is 7 rows instead of 12, and adding a textbook costs exactly one row.

The decomposition is lossless because the intersection cid multidetermines each half, which is the multivalued analogue of the functional test.

The general lesson is that BCNF is not the end of the story. A relation can satisfy every functional dependency requirement and still store the cross product of two independent facts.

Summary

Every anomaly traces to a dependency whose determinant is not a key, and each normal form restricts which dependencies may exist.

A functional dependency constrains every legal instance, not just the current rows. Armstrong's axioms are reflexivity, augmentation and transitivity, and are sound and complete. Decomposition applies to right sides only.

Attribute closure decides superkeys. An attribute on no right side is in every candidate key; one on no left side but some right side is in none.

A canonical cover has single-attribute right sides, no redundant dependency and no redundant left-side attribute, and it is not unique.

1NF requires atomic values. 2NF forbids partial dependencies and matters only with composite keys. 3NF requires each determinant to be a superkey or each determined attribute to be prime. BCNF drops the second clause.

A binary decomposition is lossless exactly when the intersection determines one of the halves. Dependency preservation asks whether every dependency is checkable without a join.

3NF synthesis from a canonical cover gives 3NF, losslessness and preservation together. BCNF decomposition gives losslessness but may lose a dependency, and the classic example is with and .

Multivalued dependencies capture redundancy no functional dependency can, and 4NF requires their determinants to be superkeys. A relation can be in BCNF and still store a cross product of independent facts.

Separately from normalisation, the schema declares domain, key and referential constraints directly, while conditions spanning several relations need an assertion or, in practice, a trigger.

Key formulas & results

Everything to memorise for the exam hall, in one card. Screenshot this for revision.

The organising principle
every anomaly traces to a dependency whose determinant is not a key
Each normal form restricts which dependencies may exist, and BCNF is the limiting case where every determinant must be a superkey.
Armstrong's axioms
reflexivity, augmentation, transitivity; derived: union, decomposition, pseudotransitivity
Sound and complete, so they derive exactly the dependencies logically implied by a given set.
Attribute closure
start with X, repeatedly add the right side of any dependency whose left side is already contained, until nothing changes
X is a superkey exactly when its closure contains every attribute.
Candidate key shortcuts
an attribute on no right side is in every candidate key; one on no left side but some right side is in none
These two tests turn an exponential search into an inspection followed by a few closures.
Canonical cover conditions
single-attribute right sides, no redundant dependency, no redundant left-side attribute
Compute in that order. The result is not unique, so answers are judged on the checks rather than on matching a fixed list.
Second normal form
no non-prime attribute is determined by a proper subset of a candidate key
Only relevant when a candidate key is composite. A relation with all-simple candidate keys is automatically in 2NF.
Third normal form
for every non-trivial X to A, X is a superkey or A is prime
The second clause exists precisely so that dependency preservation is always achievable.
Boyce-Codd normal form
for every non-trivial X to A, X is a superkey, with no escape clause
Any two-attribute relation is automatically in BCNF, which is a useful sanity check.
Lossless binary decomposition
R1 intersect R2 determines R1, or R1 intersect R2 determines R2
In words, the shared attributes must be a key of at least one piece. An empty intersection is always lossy.
The 3NF and BCNF guarantee
3NF: lossless and dependency preserving always achievable. BCNF: lossless always, preservation not always
The classic conflict is R(A,B,C) with AB to C and C to B, where no BCNF decomposition preserves AB to C.
Fourth normal form
for every non-trivial multivalued dependency, the determinant is a superkey
A relation can be in BCNF and still store the cross product of two independent facts, which is what 4NF removes.
⚠️

Traps GATE sets — and how to dodge them

These are the exact option-traps and misreads that cost marks under negative marking.

WATCH OUT
Splitting the left side of a dependency
From XY determines Z, nothing follows about X alone. Decomposition applies only to the determined side.
Why it happens: The decomposition rule is remembered without its restriction to right sides, and the symmetry looks plausible.
WATCH OUT
Stopping after finding one candidate key
Continue testing the remaining attribute combinations, since prime status depends on the full set of keys and the 3NF test depends on prime status.
Why it happens: The question says find the candidate key, or the first closure found covers everything, so the search feels finished.
WATCH OUT
Checking 3NF using the definition of BCNF
3NF has an escape: the determined attribute being prime is enough. If you never use that clause, you are testing BCNF.
Why it happens: The two definitions differ by one clause, which is easy to drop under time pressure.
WATCH OUT
Declaring a decomposition lossless because both pieces are in BCNF
They are independent. Test losslessness separately with the intersection rule, which is about keys, not about normal forms.
Why it happens: Normal form and losslessness are both goals of decomposition, so they are conflated.
WATCH OUT
Calling a decomposition with an empty intersection lossless
With no shared attribute the join is a Cartesian product, generating spurious tuples. Two rows in each piece yield four rows on rejoining.
Why it happens: The two pieces together contain all the attributes, so no data appears missing.
WATCH OUT
Treating a lost dependency as a lost constraint
The constraint still holds logically; it can just no longer be checked on a single relation, so enforcement requires a join and is usually abandoned.
Why it happens: The word lost suggests the rule no longer applies.
WATCH OUT
Inferring a functional dependency from the sample rows
A dependency is a claim about every legal instance. Unless the question states it, coincidental uniqueness in the sample proves nothing.
Why it happens: A small table often has a column that happens to be unique or that happens to determine another.
WATCH OUT
Assuming BCNF eliminates all redundancy
Multivalued dependencies produce redundancy that no functional dependency captures, and removing it requires 4NF.
Why it happens: It is the strongest form usually taught, so it reads as the end of the process.

Exam-pattern practice

PYQ-style questions with full solutions. Work through them as a readiness check — mark yourself honestly and get your gap report at the end.

Readiness check

Are you exam-ready for Integrity Constraints & Normal Forms?

10 problems from this chapter. Try each one, reveal the worked solution, mark yourself honestly — get your gap report at the end.

10 questions~7 min

5-minute revision

The whole chapter, distilled. Read this the night before the exam.

  • Every anomaly comes from a determinant that is not a key
  • A dependency constrains every legal instance, not the current rows
  • Armstrong's axioms: reflexivity, augmentation, transitivity; sound and complete
  • Decomposition splits right sides only, never left sides
  • X is a superkey exactly when its closure is everything
  • Attributes on no right side are in every candidate key; on no left side but some right side, in none
  • Canonical cover: single-attribute right sides, no redundant dependency, no redundant left attribute; not unique
  • The three anomalies are insertion, deletion and update
  • 1NF requires atomic values; 2NF forbids partial dependencies and needs a composite key to matter
  • 3NF: determinant is a superkey OR determined attribute is prime
  • BCNF: determinant must be a superkey, no exceptions; two-attribute relations always qualify
  • Lossless binary test: the intersection determines one of the halves; empty intersection is always lossy
  • Dependency preservation asks whether each dependency is checkable without a join
  • 3NF synthesis gives 3NF plus lossless plus preserving; BCNF gives lossless only
  • The classic conflict is R(A,B,C) with AB to C and C to B
  • A lost dependency still holds logically but cannot be enforced cheaply
  • Multivalued dependencies capture redundancy functional dependencies cannot; 4NF needs superkey determinants
  • Domain, key and referential constraints are declared directly; cross-relation conditions need assertions or triggers

GATE question blueprint

How this topic is asked, tier by tier — so you can prep to the pattern.

Typical weightage: 7

Question styleMarks eachTypical countWhat it tests
Normal forms21
Functional dependencies21
Decomposition21
Multivalued dependencies11

Exam-hall strategy

Battle-tested tips from mentors and toppers for this topic under the sectional clock.

  1. Always find every candidate key before assessing normal form, since prime status decides the 3NF question and finding one key is not enough. Test dependencies one at a time and write the verdict beside each, which makes partial credit possible and prevents overlooking the one violator. For the highest normal form, work upward and stop at the first failure. Losslessness and dependency preservation are separate tests, so run both and never infer one from the other. If a question gives a decomposition and asks what is wrong, check the empty-intersection case first, since it is the fastest disqualifier. In canonical cover questions, show each redundancy test with the closure you computed, because the answer is not unique and the working is what earns the mark.

Beyond the exam

Where this skill shows up in the job you're competing for — and in life.

Schema review in any serious data platform is a normal fo…

Schema review in any serious data platform is a normal form argument, and the recurring question is whether a denormalisation is worth the anomalies it reintroduces

Data warehouse star schemas deliberately violate 3NF

Data warehouse star schemas deliberately violate 3NF, accepting update anomalies because dimension tables are loaded rather than edited

Object-relational mappers generate schemas that are usual…

Object-relational mappers generate schemas that are usually in 3NF by construction, since each class becomes a table keyed by its identifier

Data quality tooling infers candidate functional dependen…

Data quality tooling infers candidate functional dependencies from sample data, then asks a human whether each is a real business rule, which is exactly the sample-versus-schema distinction in this chapter

Document databases avoid the question by nesting

Document databases avoid the question by nesting, which is a deliberate return to non-first-normal-form data with the anomalies accepted in exchange for single-read access

Where else this topic is tested

Prepare once, score in every exam that asks it.

GATE CS
GATE DA
UGC NET Computer Science
ISRO Scientist SC
BARC Computer Science

Questions aspirants ask

Pulled from the Q&A community and mentor sessions.

No, and this is a genuine engineering judgement rather than a rule. When BCNF costs a dependency that the application must enforce anyway, many designers stop at 3NF, because a constraint checkable inside one table is worth more than the small amount of redundancy BCNF would remove. Data warehouses go further and denormalise deliberately.

Compute the set of attributes that must appear in every key, then extend it systematically with subsets of the remaining attributes in increasing size, stopping a branch once a superkey is found so minimality is preserved. Since every candidate key contains the forced attributes, this search is exhaustive.

Only that no information is lost. A decomposition can be lossless and still be terrible, for example splitting off a single attribute along with the key, which preserves everything but forces a join for almost every query. Losslessness is a minimum requirement, not a design goal.

Mainly as a stepping stone, since partial dependency is the easiest anomaly to see and it introduces the idea that a subset of a key can determine something. In practice designs go straight to 3NF or BCNF, and 2NF appears in exams only as a step in identifying the highest normal form.

The pattern is, though it is rarely named. Any table storing two independent one-to-many facts about the same entity has one, and the symptom is a row count that is a product rather than a sum. Once seen this way the fix is obvious, which is why 4NF violations tend to be caught by inspection rather than by formal analysis.

Yes, and predictably so. Every decomposition replaces a scan with a join, and a query needing attributes from four normalised tables pays four times. The usual resolution is to normalise the authoritative store and maintain denormalised copies, whether as materialised views or as a separate reporting database.
Header Logo