Domain, key and referential integrity constraints, functional dependencies, attribute closure, candidate keys, minimal covers, the normal forms 1NF to BCNF, and lossless, dependency-preserving decomposition.
Integrity constraints are rules every legal database state must satisfy. The DBMS checks them on each insert, update and delete.
Domain constraint: each value comes from the attribute's domain (type, range, CHECK conditions). NOT NULL is a domain-style constraint.
Key constraint: no two tuples agree on a candidate key (UNIQUE / PRIMARY KEY).
Entity integrity: a primary key attribute can never be NULL.
Referential integrity: a foreign key value must either match the primary key (or a unique key) of some tuple in the referenced relation, or be entirely NULL.
Which operations can violate referential integrity? Inserting into, or updating the foreign key of, the referencing relation; deleting from, or updating the key of, the referenced relation. Inserting into the referenced relation never violates it.
Actions on a violating delete or update of a referenced tuple:
Action
Effect on referencing tuples
RESTRICT / NO ACTION
the delete is rejected
CASCADE
referencing tuples are deleted (or updated) too, recursively
SET NULL
foreign key set to NULL
SET DEFAULT
foreign key set to its default value
With CASCADE on a self-referencing table, a delete can spread down a whole chain of tuples.
2. Functional dependencies and attribute closure
A functional dependency (FD) holds in if any two tuples that agree on also agree on . It is trivial if .
Armstrong's axioms (sound and complete):
Reflexivity: if then .
Augmentation: if then .
Transitivity: if and then .
Derived rules: union (), decomposition (), pseudo-transitivity (). Note: does not give .
Attribute closure : start with ; repeatedly, for each FD with , add . Stop when nothing changes. follows from iff .
Finding candidate keys:
Attributes that appear on no right-hand side must be in every key. Compute their closure; if it is all of , that is the only key.
Otherwise add other attributes one at a time (then two at a time, ...) and keep the minimal sets whose closure is .
An attribute is prime if it belongs to some candidate key, otherwise non-prime.
3. Minimal cover and equivalence of FD sets
Two FD sets and are equivalent if each implies every FD of the other (). Check: for each in , compute under and confirm ; then the other way round.
A minimal (canonical) cover of is an equivalent set with:
a single attribute on every right-hand side;
no extraneous attribute on any left-hand side;
no redundant FD.
Procedure:
Split right sides: becomes , .
For each FD , the attribute is extraneous if (closure under the current set). Then replace with .
For each FD , remove it if is still in computed without that FD.
Do step 2 before step 3. A set can have more than one minimal cover, so in an MCQ check each option for equivalence rather than expecting one fixed answer.
Minimal covers are the input to the 3NF synthesis algorithm: one relation per FD group, plus a key relation if no relation contains a candidate key.
4. Normal forms: 1NF, 2NF, 3NF, BCNF
Normal forms limit redundancy and update anomalies (insertion, deletion and modification anomalies).
Form
Condition
1NF
every attribute value is atomic (no lists, no repeating groups)
2NF
1NF + no partial dependency: no non-prime attribute depends on a proper subset of a candidate key
3NF
for every non-trivial : is a superkey or is prime
BCNF
for every non-trivial : is a superkey
Each form implies the ones above it: BCNF ⇒ 3NF ⇒ 2NF ⇒ 1NF.
Quick facts:
If every candidate key is a single attribute, a 1NF relation is in 2NF.
If every attribute is prime, the relation is in 3NF.
A relation with two attributes is always in BCNF.
3NF forbids transitive dependencies of non-prime attributes on a key ( with not a superkey, non-prime).
Finding the highest normal form: find all candidate keys, mark prime attributes, then test each FD from BCNF downwards. The first FD that fails BCNF decides whether you drop to 3NF, 2NF or 1NF.
Every BCNF relation is in 3NF, every 3NF relation is in 2NF, and so on.
5. Decomposition: lossless join and dependency preservation
A decomposition of into should be:
Lossless (non-additive) join: joining the pieces gives back exactly , never extra (spurious) tuples. For a binary decomposition into and , it is lossless iff
i.e. the common attributes form a superkey of at least one piece. If they share no attribute, the join is a Cartesian product and the decomposition is lossy (unless one side is trivial).
Dependency preserving: , where is the set of FDs of that use only attributes of . Then every FD can be checked inside a single relation without joins.
Target
Lossless?
Dependency preserving?
3NF (synthesis)
always achievable
always achievable
BCNF
always achievable
not always
Classic example: with and . Keys are and ; all attributes are prime, so is in 3NF, but violates BCNF. The BCNF split , is lossless (common ) but loses .
BCNF decomposition: pick a violating ; split into and ; repeat on each piece.
Formulas to remember
FD implied by a set
Superkey test
Lossless binary decomposition
3NF condition
BCNF condition
Dependency preservation
Common mistakes
Calling an FD a 2NF violation when the determinant is not part of any key; that is a transitive dependency (a 3NF violation).
Checking 2NF or 3NF against only one candidate key; prime means 'in some candidate key'.
Splitting a left side: XY → Z does not imply X → Z.
Testing losslessness by whether the pieces cover all attributes; the common attributes must be a key of one piece.
Thinking inserts into the referenced (parent) table can violate referential integrity; only child inserts and parent deletes or key updates can.
Worked examples
Try each step yourself, then reveal the working.
Example 1: Candidate keys and the highest normal form
numerical
with . Find all candidate keys and the highest normal form of .
Step 1: Which attributes must be in every key?
Try it on paper first.
Example 2: Minimal cover
numerical
Find a minimal cover of .
Step 1: Split the right-hand sides.
Try it on paper first.
Example 3: Lossless check and BCNF decomposition
numerical
with . Find the key, then decompose into BCNF.
Step 1: Find the key.
Try it on paper first.
Example 4: 3NF but not BCNF
conceptual
: student, course, teacher, with (a student has one teacher per course) and (each teacher teaches one course). Find the highest normal form and say what a BCNF decomposition costs.
Step 1: Find the keys.
Try it on paper first.
Previous year questions
6 official GATE DA questions on this topic, newest first.
10 questions: up to 4 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.
Mark as mastered
Loading your progress…
My revision notes
Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.