Skip to main content

Databases (DBMS)

Normalization

Normalization is the biggest scoring block in DBMS: compute closures, find every candidate key, name the highest normal form, and test decompositions for lossless join and dependency preservation.

~6 hrs ~1.5–2 marks · Must-score 10 samples · 8 practice · 9 cards

GATE CSE normalization — functional dependencies, Armstrong axioms, attribute closure, candidate keys, minimal cover, 1NF/2NF/3NF/BCNF, 4NF and MVDs, lossless and dependency-preserving decomposition, with worked examples, sample questions, flashcards and drills.

Learning outcomes

  • Apply Armstrong axioms and compute attribute closures and candidate keys
  • Find the minimal cover and test equivalence of FD sets
  • Decide the highest normal form (1NF, 2NF, 3NF, BCNF) of a relation
  • Test lossless-join and dependency-preserving decompositions and recognise 4NF and MVDs

Functional dependencies, closure and candidate keys

  • A FUNCTIONAL DEPENDENCY X -> Y holds in R if any two tuples that agree on X also agree on Y. It is a property of the SCHEMA (all legal instances), not of one instance. X -> Y is TRIVIAL if Y is a subset of X.
  • ARMSTRONG AXIOMS (sound and complete): REFLEXIVITY (Y subset of X implies X -> Y), AUGMENTATION (X -> Y implies XZ -> YZ), TRANSITIVITY (X -> Y and Y -> Z imply X -> Z). Derived rules: UNION (X -> Y, X -> Z give X -> YZ), DECOMPOSITION (X -> YZ gives X -> Y and X -> Z), PSEUDOTRANSITIVITY (X -> Y and WY -> Z give WX -> Z).
  • ATTRIBUTE CLOSURE X+ = all attributes functionally determined by X. Algorithm: start with result = X; repeatedly, for every FD A -> B with A subset of result, add B; stop when nothing changes. X -> Y holds iff Y is a subset of X+. X is a SUPER KEY iff X+ = all attributes.
  • CANDIDATE KEYS: an attribute that never appears on the RIGHT side of any FD must be in EVERY key; an attribute that appears only on the right side is in NO key; attributes that appear on both sides are tested. Start with the necessary attributes, compute the closure, and add attributes until it covers R; then check minimality.
  • EQUIVALENCE: F and G are equivalent if F+ = G+, i.e. every FD of G follows from F and vice versa (check using closures). A MINIMAL (CANONICAL) COVER: (1) right sides are single attributes, (2) no extraneous attribute on any left side, (3) no redundant FD. Steps: split right sides, remove extraneous left attributes, remove redundant FDs.
  • Number of super keys = number of attribute subsets that contain a candidate key. Number of candidate keys with a cycle A -> B -> C -> A over R(A,B,C) is 3.
  • CLOSURE OF A SET OF FDs F+ is every FD implied by F; it can be exponentially large, so GATE never lists it. Use ATTRIBUTE CLOSURE X+ to test one FD at a time. The cost is polynomial: at most n rounds for n attributes.
  • TRIVIAL and NON-TRIVIAL: X -> Y is trivial if Y is a subset of X, completely non-trivial if X and Y are disjoint. A relation with no non-trivial FD has the whole attribute set as its only candidate key.
  • FD FROM INSTANCE: a given instance can DISPROVE an FD (two tuples agree on X but differ on Y) but never prove it; FDs are declared on the schema. A question that says "which FD can be inferred to hold" asks for FDs not violated by any pair of tuples.
  • SHORTCUT FOR KEYS: (1) put every attribute that never appears on any RHS in the key; (2) if their closure is R, that set is the only key; (3) otherwise add attributes from the middle group one at a time (then pairs, ...) until the closure is R, skipping supersets of keys already found.

Formulas to remember

  • X -> Y holds iff Y is a subset of X+
  • Super key iff X+ = R
  • R(A,B,C,D) with A -> B, B -> C, C -> D, D -> A: candidate keys A, B, C, D (4 keys)
Where the attribute appears in FRole in candidate keys
never on any right-hand side (LHS only, or not in F at all)in EVERY candidate key
only on right-hand sidesin NO candidate key
on both left and right sidesmay or may not be in a key: test by closure
all attributes are on both sides in a cycleeach attribute alone can be a key

Worked example

Problem. R(A, B, C, D, E) with F = { A -> B, BC -> E, ED -> A }. Find all candidate keys.

Solution. C and D never appear on the right side, so every key contains CD. Try adding one attribute: ACD+ = A,C,D then B (A -> B), then E (BC -> E) = all, so ACD is a key. BCD+ = B,C,D,E (BC -> E), A (ED -> A) = all, so BCD is a key. ECD+ = E,C,D, A (ED -> A), B (A -> B) = all, so ECD is a key. The candidate keys are ACD, BCD and ECD: 3 keys; every attribute is prime.

Step-by-step attribute closures of ACD, BCD, ECD and CD for R(A,B,C,D,E) with FDs A to B, BC to E, ED to A, showing three candidate keys.
Closure computation: CD is in every key; ACD, BCD and ECD each reach all five attributes, while CD+ stays CD. Three candidate keys, all attributes prime.

Normal forms: 1NF, 2NF, 3NF, BCNF, 4NF

  • 1NF: every attribute value is atomic (no repeating groups or multivalued/composite values). 2NF: 1NF and no PARTIAL dependency, i.e. no non-prime attribute depends on a proper subset of a candidate key. 3NF: for every non-trivial FD X -> A, either X is a super key OR A is a PRIME attribute (no transitive dependency of a non-prime on a key). BCNF: for every non-trivial FD X -> Y, X must be a super key.
  • Containment: BCNF is stricter than 3NF, which is stricter than 2NF, which is stricter than 1NF. Every relation with only two attributes is in BCNF. Every relation in which ALL attributes are prime is in 3NF. If every candidate key is a single attribute, the relation is at least in 2NF.
  • PROCEDURE TO FIND THE HIGHEST NORMAL FORM: (1) find all candidate keys and the prime attributes; (2) check BCNF: is the LHS of every non-trivial FD a super key? (3) if not, check 3NF: is the RHS prime? (4) if not, check 2NF: does a non-prime attribute depend on part of a key? (5) otherwise 1NF.
  • ANOMALIES removed by normalization: insertion, deletion and update anomalies caused by redundancy. Denormalization deliberately reintroduces redundancy for speed.
  • MULTIVALUED DEPENDENCY X ->> Y: for each X value, the set of Y values is independent of the other attributes (given X, Y and the rest Z are independent). Every FD is an MVD. A non-trivial MVD arises for independent multivalued facts such as Course ->> Teacher and Course ->> Book.
  • 4NF: for every non-trivial MVD X ->> Y, X is a super key. 4NF is stricter than BCNF; a relation in BCNF may violate 4NF. 5NF (PJNF) deals with join dependencies.
  • ANOMALY-driven decomposition fixes the schema, but information must not be lost: tests follow in the next section.
Normal formCondition on every non-trivial FD X -> ATypical violation
2NFno non-prime attribute depends on a proper part of a keypartial dependency
3NFX is a super key OR A is primetransitive dependency
BCNFX is a super keyX -> A where A is prime but X is not a key
4NFfor MVD X ->> Y, X is a super keyindependent multivalued facts

Worked example

Problem. R(A, B, C, D) with F = { AB -> C, C -> D }. State the highest normal form.

Solution. A and B never appear on the right, so AB is in every key and AB+ = ABCD: the only candidate key is AB; prime = {A, B}. C -> D: C is not a super key and D is not prime, so 3NF fails. Partial dependency: A+ = A and B+ = B, so no non-prime attribute depends on part of the key; 2NF holds. Highest normal form = 2NF.

Staircase of normal forms 1NF, 2NF, 3NF, BCNF and 4NF with the condition each adds and a typical violation.
Normal-form ladder: BCNF demands a super-key left side for every FD; 3NF allows a prime right side; 2NF forbids partial dependencies; 1NF needs atomic values.

Minimal cover and equivalence of FD sets

  • A MINIMAL (CANONICAL) COVER Fc of F satisfies: (1) every FD has a SINGLE attribute on the right; (2) no attribute on a left side is EXTRANEOUS; (3) no FD is REDUNDANT; and Fc+ = F+. A set can have several different minimal covers, but they all have the same closure.
  • EXTRANEOUS attribute test for AB -> C: A is extraneous if the shorter FD B -> C already follows from F, i.e. C is in B+ computed using all the FDs of F. Test each left-side attribute separately.
  • REDUNDANT FD test: remove X -> A from the set and compute X+ using the remaining FDs; if A is still in X+, the FD is redundant and stays removed. Always test after the left sides have been reduced.
  • ORDER matters only for which minimal cover you get, not for correctness. Because GATE asks for the NUMBER of FDs in a minimal cover, make sure to finish all three steps: split, reduce left sides, delete redundant FDs.
  • TWO FD SETS F and G are EQUIVALENT if every FD of F follows from G (check using closures under G) and every FD of G follows from F. If only one direction holds, F covers G (or G covers F) but they are not equivalent.
  • The minimal cover is the starting point of 3NF synthesis and of checking dependency preservation, so it appears in many GATE questions as an intermediate step.
StepQuestionAction
1. SplitIs any right side larger than one attribute?X -> AB becomes X -> A and X -> B
2. Reduce left sidesIs an attribute of a composite left side extraneous?Drop it if the reduced FD already follows
3. Remove redundancyDoes the FD follow from the others?Delete it

Worked example

Problem. Find a minimal cover of F = { A -> BC, B -> C, A -> B, AB -> C }. How many FDs does it contain and what is the candidate key of R(A,B,C)?

Solution. Split: A -> B, A -> C, B -> C, A -> B (duplicate), AB -> C. Reduce left sides: in AB -> C, B alone already gives C (B -> C is in F), so A is extraneous and AB -> C becomes B -> C, a duplicate. Remaining: A -> B, A -> C, B -> C. Redundancy: remove A -> C and compute A+ from { A -> B, B -> C }: A, B, C. C is still determined, so A -> C is redundant. Minimal cover = { A -> B, B -> C } with 2 FDs. A is never on a right side and A+ = ABC, so the only candidate key is A.

Worked normal-form checks

  • Always organise the work in four lines: (1) FDs, (2) candidate keys and prime attributes, (3) FDs that violate BCNF, (4) of those, which also violate 3NF (non-prime RHS) and which violate 2NF (partial dependency).
  • For 2NF only FDs whose LEFT side is a PROPER SUBSET of a candidate key and whose RIGHT side is non-prime matter. If every candidate key is a single attribute, no partial dependency exists.
  • For 3NF the dangerous FDs are those whose left side is NOT a super key AND whose right side is NOT prime. If every attribute is prime, the relation is in 3NF whatever the FDs are.
  • When a relation violates BCNF only because of FDs whose right side is prime (as in R(A,B,C), AB -> C, C -> B), it is in 3NF but not in BCNF, and BCNF decomposition may lose AB -> C.
R and FCandidate keysHighest NFReason
R(A,B,C,D), F = { A -> B, C -> D }AC1NFA -> B is a partial dependency on key AC
R(A,B,C,D), F = { AB -> C, C -> D }AB2NFC -> D is transitive (non-prime D)
R(A,B,C), F = { AB -> C, C -> B }AB, AC3NFC -> B has prime RHS but C is no key
R(A,B,C), F = { A -> B, B -> C }A2NFB -> C: B not a key, C non-prime
R(A,B,C), F = { A -> BC }ABCNFonly FD has the key as its left side
R(A,B,C), F = { A -> B, B -> A, A -> C }A, BBCNFA and B are both keys

Worked example

Problem. R(A, B, C, D) has F = { A -> B, C -> D }. Find the candidate key, the highest normal form, and decompose into BCNF.

Solution. A and C never appear on a right side, so AC is in every key; AC+ = A, C, B (A -> B), D (C -> D) = ABCD, so AC is the only candidate key and A, C are prime; B, D are non-prime. A -> B: B is non-prime and A is a proper subset of the key, a partial dependency, so 2NF fails: R is only in 1NF. BCNF decomposition: A -> B violates, so split into R1(A, B) and R2(A, C, D). In R2 the key is AC and C -> D violates BCNF, so split R2 into R21(C, D) and R22(A, C). Final schema: (A, B), (C, D), (A, C), all in BCNF. Lossless (each split joined on a key of one part) and dependency preserving (A -> B in the first piece, C -> D in the second).

Decomposition: lossless join and dependency preservation

  • DECOMPOSITION replaces R by R1, R2, ... with R = R1 U R2 U .... It must be LOSSLESS (natural join of the pieces gives back exactly R, no spurious tuples) and ideally DEPENDENCY PRESERVING (the union of the FDs projected on the pieces implies all of F).
  • LOSSLESS test for BINARY decomposition: R1 and R2 are lossless iff (R1 n R2) -> R1 OR (R1 n R2) -> R2 holds in F+ (the common attributes form a key of one of the parts). For many pieces use the TABLEAU (chase) test, or join pieces step by step as a chain.
  • DEPENDENCY PRESERVATION: compute F1 = FDs of F+ restricted to R1, F2, ...; the decomposition preserves dependencies if (F1 U F2 U ...)+ = F+. Easier practical test: for every FD X -> Y in F, grow Z = X by repeatedly taking Z = Z U ((Z n Ri)+ n Ri) for each Ri; the FD is preserved iff Y is a subset of Z.
  • A lossy decomposition produces spurious tuples on rejoining; a decomposition with no common attribute (disjoint schemas) is always lossy unless one part is empty.
  • BCNF DECOMPOSITION algorithm: while some relation has a violating FD X -> Y (X not a super key), replace it by (X U Y) and (R - (Y - X)). It is ALWAYS LOSSLESS but may NOT preserve dependencies, and BCNF is not always achievable with dependency preservation.
  • 3NF SYNTHESIS: find a minimal cover; make one relation for each FD (merge FDs with the same left side); if no relation contains a candidate key, add one that does; drop any relation contained in another. The result is ALWAYS lossless AND dependency preserving.
  • A 4NF decomposition for X ->> Y splits R into (X U Y) and (R - Y); it is lossless.

Formulas to remember

  • Binary lossless test: (R1 n R2) -> R1 or (R1 n R2) -> R2
  • BCNF split on X -> Y: R1 = X U Y, R2 = R - (Y - X)
  • 3NF synthesis: lossless AND dependency preserving always
  • BCNF decomposition: lossless always, dependency preserving not always

Worked example

Problem. R(A, B, C) with F = { AB -> C, C -> B }. Is R in BCNF? Decompose it and check dependency preservation.

Solution. Keys: A is in every key; AB+ = ABC and AC+ = ABC (C -> B), so the keys are AB and AC and all attributes are prime. C -> B has a non-key left side so BCNF fails, but B is prime so 3NF holds. BCNF split on C -> B gives R1(C, B) and R2(A, C). The common attribute C is a key of R1 (C -> B), so the split is lossless. AB -> C needs A, B and C in one relation, which is lost: not dependency preserving.

Lossy decomposition producing spurious tuples versus the lossless BCNF split R1(C,B) and R2(A,C), with the loss of AB to C and the tests for lossless join and dependency preservation.
A split is lossless when the common attributes form a key of one part; BCNF splits are always lossless but may lose a dependency such as AB -> C.

Worked decomposition problems: preservation, 3NF synthesis and 4NF

  • DEPENDENCY PRESERVATION via the growing test: for X -> Y start with Z = X and repeat Z = Z U ((Z n Ri)+ n Ri) over all pieces Ri until Z stops growing; the FD is preserved iff Y is in Z. This works even when X -> Y is not directly inside any piece.
  • LOSSLESS test for three or more pieces: join them in an order so that each step satisfies the binary test (common attributes form a key of one side). A tableau (chase) gives the same answer systematically: a decomposition is lossless iff the chase produces a row of all distinguished symbols.
  • 3NF SYNTHESIS in four lines: minimal cover; one relation per FD (merge same left side); add a relation with a candidate key if none contains one; delete contained relations. It always gives a lossless, dependency-preserving 3NF design.
  • MVD rules: every FD X -> Y implies X ->> Y; if X ->> Y then X ->> (R - X - Y) (complementation); trivial MVD: Y subset of X, or X U Y = R. 4NF decomposition on X ->> Y gives R1(X, Y) and R2(X, R - X - Y).
  • REDUNDANCY from independent multivalued facts: if one course has t teachers and b books, a single table stores t * b rows, but the 4NF split stores only t + b rows.
  • A relation with two attributes is in BCNF and in 4NF. Any BCNF relation whose candidate key is a single attribute is also in 4NF (all MVDs there follow from FDs with a key on the left).
Decomposition goalMethodLossless?Dependency preserving?
BCNFrepeatedly split on a violating FDalwaysnot always
3NFsynthesis from a minimal coveralwaysalways
4NFsplit on a violating non-trivial MVDalwaysnot always
Binary split R1, R2test (R1 n R2) -> R1 or R2by testby growing test

Worked example

Problem. R(A, B, C, D) with F = { A -> B, B -> C, C -> D, D -> B } is decomposed into R1(A, B), R2(B, C) and R3(B, D). Is the decomposition (i) lossless and (ii) dependency preserving?

Solution. (i) Join R1 and R2: common attribute B; B+ = {B, C, D} contains all of R2 = {B, C}, so B is a key of R2 and the join is lossless, giving (A, B, C). Join this with R3(B, D): common attribute B and B -> D (B -> C -> D), so B is a key of R3: lossless. (ii) A -> B lies in R1 and B -> C in R2. D -> B lies in R3 (D+ = {D, B, C}, intersected with {B, D} gives {B, D}). C -> D is not inside one piece, so run the growing test: Z = {C}; with R2: (C n BC)+ n BC = C+ n BC = {C, D, B} n {B, C} = {B, C}, so Z = {B, C}; with R3: (Z n BD)+ n BD = B+ n BD = {B, C, D} n {B, D} = {B, D}, so Z = {B, C, D}. D is in Z, so C -> D is preserved. All four FDs are preserved: the decomposition is lossless and dependency preserving.

Worked 3NF synthesis and 4NF decomposition

  • Synthesis always produces a schema that is in 3NF; some of its relations may even be in BCNF. It may contain redundancy that BCNF would remove, which is the price for preserving all FDs.
  • After synthesis, you can check the result: each FD of the minimal cover appears inside a relation (dependency preserving) and one relation contains a candidate key (lossless).

Worked example

Problem. R(A, B, C, D) has F = { A -> B, B -> C }. Find the candidate key and a 3NF decomposition that is lossless and dependency preserving. Then, for R(Course, Teacher, Book) with Course ->> Teacher and Course ->> Book, give the 4NF decomposition.

Solution. Key: A and D never appear on a right side; AD+ = A, D, B (A -> B), C (B -> C) = ABCD, so AD is the only candidate key. F is already a minimal cover. One relation per FD: R1(A, B) and R2(B, C). Neither contains the key AD, so add R3(A, D). Decomposition: (A, B), (B, C), (A, D): lossless (R3 holds the key) and dependency preserving (each FD sits in one piece). For the 4NF part: the key of R is all three attributes, and Course ->> Teacher is non-trivial with Course not a super key, so split into R1(Course, Teacher) and R2(Course, Book). If a course has 3 teachers and 4 books, R stores 3 * 4 = 12 rows while R1 and R2 store 3 + 4 = 7 rows.

Exam tips

  • Always list attributes that never appear on a right side first: they are in every candidate key.
  • BCNF test: look at LHS of each FD (is it a super key?). 3NF test adds the prime-attribute escape on the RHS.
  • If a relation has only prime attributes it is in 3NF; a two-attribute relation is always in BCNF.
  • Binary lossless test: the common attributes must determine at least one of the two schemas.
  • BCNF decomposition may lose dependencies; 3NF synthesis never does.
Exam pattern · 10 questions

GATE sample questions & answers

10 GATE-style MCQs for Normalization with full explanations. Attempt each question before revealing the answer.

Q1 Classic GATE candidate-key counting

R(A, B, C, D, E) has F = { A -> B, BC -> E, ED -> A }. The number of candidate keys of R is:

  • A) 1
  • B) 2
  • C) 3
  • D) 4
Show answer & explanation

Answer: C

CD is in every key; ACD, BCD and ECD each have closure R and are minimal. There are 3 candidate keys.

Q2

For the same R(A, B, C, D, E) and F, the highest normal form is:

  • A) 1NF
  • B) 2NF
  • C) 3NF
  • D) BCNF
Show answer & explanation

Answer: C

All attributes belong to some candidate key (all prime), so 3NF holds. A -> B has a non-key left side, so BCNF fails.

Q3

R(A, B, C, D) with F = { AB -> C, C -> D }. The highest normal form of R is:

  • A) 1NF
  • B) 2NF
  • C) 3NF
  • D) BCNF
Show answer & explanation

Answer: B

The only key is AB. There is no partial dependency, so 2NF holds. C -> D is a transitive dependency of a non-prime on the key, so 3NF fails.

Q4

R(A, B, C) with F = { AB -> C, C -> B }. The highest normal form is:

  • A) 1NF
  • B) 2NF
  • C) 3NF
  • D) BCNF
Show answer & explanation

Answer: C

Keys are AB and AC, so B is prime. C -> B violates BCNF (C is not a super key) but satisfies 3NF because B is prime.

Q5

R(A, B, C, D) with F = { A -> B, B -> C, C -> D }. Which decomposition is lossless?

  • A) {A,B} and {C,D}
  • B) {A,B}, {B,C} and {C,D}
  • C) {A,C} and {B,D}
  • D) {A,D} and {B,C}
Show answer & explanation

Answer: B

Options A, C and D have no common attribute (or no key in common) so they are lossy. In B, AB and BC share B (B -> C) giving ABC, which shares C with CD (C -> D): the chain is lossless.

Q6

R(A, B, C, D) with F = { A -> BCD, B -> A }. The number of super keys of R is:

  • A) 8
  • B) 10
  • C) 12
  • D) 14
Show answer & explanation

Answer: C

Candidate keys are A and B. Subsets containing neither A nor B are {}, {C}, {D}, {C,D}: 4 of 16, so 12 sets contain A or B and are super keys.

Q7

Which of the following statements is FALSE?

  • A) Every relation with two attributes is in BCNF
  • B) A 3NF synthesis is lossless and dependency preserving
  • C) A BCNF decomposition is always dependency preserving
  • D) A relation in which all attributes are prime is in 3NF
Show answer & explanation

Answer: C

BCNF decomposition is always lossless but may lose dependencies (e.g. R(A,B,C) with AB -> C, C -> B).

Q8

R(Course, Teacher, Book) has the MVDs Course ->> Teacher and Course ->> Book and no non-trivial FDs. R is in:

  • A) 3NF only
  • B) BCNF but not 4NF
  • C) 4NF
  • D) 2NF only
Show answer & explanation

Answer: B

The key is all three attributes and there are no non-trivial FDs, so R is in BCNF. The MVDs have a non-key left side Course, so 4NF is violated.

Q9

If X -> Y and WY -> Z hold in a relation, then which FD must also hold?

  • A) X -> Z
  • B) WX -> Z
  • C) Y -> W
  • D) Z -> X
Show answer & explanation

Answer: B

Pseudotransitivity: from X -> Y augment with W to get WX -> WY, then WY -> Z gives WX -> Z by transitivity.

Q10

R(A, B, C, D) with F = { A -> B, B -> C, C -> D, D -> A }. The number of candidate keys is:

  • A) 1
  • B) 2
  • C) 3
  • D) 4
Show answer & explanation

Answer: D

The FDs form a cycle, so each of A, B, C and D determines all attributes: 4 candidate keys.

Topic drill · 8 questions

8 practice questions — Normalization

Extra page-specific practice beyond the GATE samples. Attempt all 8, then reveal answers to check your reasoning.

P1

R(A, B, C, D) has F = { A -> B, C -> D }. The highest normal form of R is:

  • A) 1NF
  • B) 2NF
  • C) 3NF
  • D) BCNF
Show answer & explanation

Answer: A) 1NF

The only key is AC. A -> B and C -> D are partial dependencies of non-prime attributes, so 2NF fails; the relation is in 1NF.

P2

The decomposition of R(A, B, C) with F = { A -> B } into R1(A, B) and R2(B, C) is:

  • A) lossless and dependency preserving
  • B) lossy but dependency preserving
  • C) lossless but not dependency preserving
  • D) neither lossless nor dependency preserving
Show answer & explanation

Answer: B) lossy but dependency preserving

The common attribute B does not determine AB or BC (only A -> B holds), so the join can create spurious tuples. A -> B is preserved inside R1.

P3

R(A, B, C) with F = { A -> B } is decomposed into R1(A, B) and R2(A, C). This decomposition is:

  • A) lossy and not dependency preserving
  • B) lossless and dependency preserving
  • C) lossy but dependency preserving
  • D) lossless but not dependency preserving
Show answer & explanation

Answer: B) lossless and dependency preserving

The common attribute A is a key of R1 (A -> B), so the join is lossless; A -> B lives in R1.

P4

The minimal cover of F = { A -> B, B -> C, A -> C } contains how many functional dependencies?

  • A) 1
  • B) 2
  • C) 3
  • D) 4
Show answer & explanation

Answer: B) 2

A -> C is redundant because A -> B and B -> C imply it. The minimal cover is { A -> B, B -> C }.

P5

R(A, B, C, D, E) with F = { A -> B, B -> C, C -> D, D -> E }. How many candidate keys does R have and what is its highest normal form?

  • A) one key (A) and 2NF
  • B) one key (A) and BCNF
  • C) five keys and BCNF
  • D) one key (A) and 3NF
Show answer & explanation

Answer: A) one key (A) and 2NF

A+ = ABCDE and A never appears on a right side, so A is the only key. B -> C etc. are transitive dependencies of non-prime attributes, so 3NF fails; the key is a single attribute so there is no partial dependency: 2NF.

P6

Which of the following relations is always in BCNF?

  • A) a relation with three attributes
  • B) a relation whose attributes are all prime
  • C) a relation with exactly two attributes
  • D) a relation in 2NF
Show answer & explanation

Answer: C) a relation with exactly two attributes

With two attributes any non-trivial FD has a single attribute on the left that determines the other, hence it is a key. All-prime relations are only guaranteed 3NF.

P7

If F = { A -> B, B -> C } on R(A, B, C), the closure (AB)+ equals:

  • A) AB
  • B) ABC
  • C) AC
  • D) BC
Show answer & explanation

Answer: B) ABC

AB gives A -> B (already in), B -> C adds C; the closure is ABC.

P8

The BCNF decomposition of R(A, B, C) with F = { A -> B } on the violating FD gives:

  • A) (A, B) and (A, C)
  • B) (A, B) and (B, C)
  • C) (A, C) and (B, C)
  • D) (A, B, C) is already in BCNF
Show answer & explanation

Answer: A) (A, B) and (A, C)

A -> B violates BCNF because A is not a key (key is AC). Split on X -> Y: (X U Y) = (A, B) and R - (Y - X) = (A, C).

Topic FAQs

How do I find all candidate keys quickly?

Find attributes that never occur on any right side (they are in every key), compute their closure, then add other attributes one at a time. Attributes that occur only on right sides never belong to a key.

What is the difference between 3NF and BCNF?

3NF allows an FD X -> A where X is not a super key provided A is prime; BCNF demands that X is always a super key. So BCNF is stricter than 3NF.

Does BCNF decomposition always preserve dependencies?

No. BCNF decomposition is always lossless, but some dependencies can be lost. 3NF synthesis is both lossless and dependency preserving.

What is a multivalued dependency and when does 4NF apply?

X ->> Y means the Y values for an X value are independent of the other attributes. A relation is in 4NF if every non-trivial MVD has a super key on the left; a BCNF relation with independent multivalued facts may still fail 4NF.

Quick revision · 9 cards

9 flashcards — Normalization

Hover a card to reveal the answer with a 3D flip. On touch devices, tap the card or use Show answer.

Q1 Armstrong axioms?
Q2 How do you compute X+?
Q3 Which attributes must be in every candidate key?
Q4 BCNF condition?
Q5 3NF condition?
Q6 Binary lossless-join test?
Q7 Which decomposition guarantees dependency preservation?
Q8 What is a minimal cover?
Q9 4NF condition?