Lossless join and dependency preservation
Decomposing a relation to reach a normal form: the lossless-join property (spurious tuples, the binary test, the chase tableau test), dependency preservation (projecting the dependencies, the polynomial test), why the two properties are independent, the BCNF decomposition algorithm (always lossless, sometimes loses a dependency) and 3NF synthesis from a minimal cover (always lossless and dependency preserving), with every test checked by brute force and by constructing counterexample relations.
Why it exists
A schema that violates a normal form is repaired by decomposition: replace by smaller relations with . A decomposition is only acceptable if it loses neither data (we must be able to rebuild by joining the pieces) nor constraints (every dependency should still be checkable inside one piece). GATE asks to test both properties and to run the decomposition algorithms.
Prerequisites
You need normal forms and the reasons for decomposing (normal forms) and closures of attribute sets (functional dependencies).
Precise definitions
Let have dependencies and be decomposed into .
- The decomposition is lossless-join if for every legal instance of (every relation that satisfies ) It always holds that ; a lossy decomposition produces extra, spurious tuples.
- The projection of on is (all implied dependencies that fit inside , not only the given ones that do).
- The decomposition is dependency preserving if , that is, if every dependency of follows from the dependencies that can be checked inside the individual pieces.
How it works
Lossless join
Why losslessness can fail. with and the instance {(1, x, p), (2, x, q)}. Splitting into and and joining on gives four tuples; the two extra ones are spurious. Splitting into and , joined on , gives back exactly :
A lossy and a lossless decomposition of the same relation: start
Computed, not typed| A | B | C |
|---|---|---|
| 1 | x | p |
| 2 | x | q |
Step 0
An instance of R in which A → B holds. We decompose R into R1(A, B) and R2(B, C): the common attribute B does not determine either piece (B → A and B → C do not follow from F).
Test for two pieces. The decomposition of into and is lossless iff the common attributes determine one of the pieces: In the example determines neither nor (lossy), but determines (lossless).
General test: the chase. Build a tableau with one row per piece: in the column of attribute put the distinguished symbol if the piece contains , otherwise a fresh symbol . For every dependency of , wherever two rows agree on , make their symbols in the columns of equal (an replaces a ). Repeat until nothing changes. The decomposition is lossless iff some row consists only of distinguished symbols.
A lossless decomposition (the chase succeeds): start
Computed, not typed| A | B | C | D |
|---|---|---|---|
| a_A | a_B | b1_C | b1_D |
| b2_A | a_B | a_C | b2_D |
| b3_A | b3_B | a_C | a_D |
Step 0
R(A, B, C, D) is decomposed into R1(A, B), R2(B, C), R3(C, D); F = { B → C, C → D }. The tableau has one row per piece: the symbol a_X (distinguished) where the piece contains attribute X, a different symbol b (non-distinguished) elsewhere. The decomposition is lossless iff the dependencies can turn some row into all a's.
For , and the pieces , , : makes the first two rows agree on (the first row gets ); then gives to the rows with : the first row becomes all distinguished: lossless. A failing case:
A lossy decomposition (the chase fails): start
Computed, not typed| A | B | C |
|---|---|---|
| a_A | a_B | b1_C |
| b2_A | a_B | a_C |
Step 0
R(A, B, C) is decomposed into R1(A, B), R2(B, C); F = { A → B }. The tableau has one row per piece: the symbol a_X (distinguished) where the piece contains attribute X, a different symbol b (non-distinguished) elsewhere. The decomposition is lossless iff the dependencies can turn some row into all a's.
With and pieces , the dependency changes nothing useful and no row becomes all-distinguished: lossy. Moreover the final tableau, read as a relation, is a legal instance (the chase ended, so it satisfies ) whose join of projections contains the all- tuple although the relation does not: an explicit counterexample, checked by program on 400 random decompositions.
Dependency preservation
To test whether is preserved, grow a set starting from : repeat, for each piece , until stops growing. The dependency is preserved iff . (It tests only attribute closures with respect to , never computes .) The decomposition is dependency preserving iff every dependency of passes. The test equals the definition (union of the projected dependencies implies ) on 500 random cases.
The two properties are independent
Testing decompositions: start
Computed by a script, not typed| decomposition | lossless join | dependency preserving |
|---|---|---|
| R(A, B, C), F = { A → B } into { AB, BC } | ||
| R(A, B, C), F = { A → B } into { AB, AC } | ||
| R(A, B, C), F = { AB → C, C → B } into { BC, AC } | ||
| R(A, B, C, D), F = { B → C, C → D } into { AB, BC, CD } | ||
| R(A, B, C, D), F = { A → B, C → D } into { AB, CD } | ||
| R(A, B, C), F = { A → B, B → C } into { AB, AC } | ||
| R(A, B, C), F = { A → B, B → C } into { AB, BC } | ||
| R(A, B, C), F = { A → B } into { AC, BC } |
Step 0
Lossless: the chase produces a row of distinguished symbols (for two pieces: the common attributes determine one piece). Dependency preserving: every dependency of F can be checked inside one piece, or follows from the dependencies that can. The two properties are independent: all four combinations occur.
All four combinations occur: for is both; is dependency preserving but lossy; for is lossless but loses ; for is neither.
BCNF decomposition
Algorithm. While some piece is not in BCNF, take a violating dependency with not a superkey of (use the closure within , ) and replace by and . The two new pieces share , which determines , so each step is lossless; the process terminates with all pieces in BCNF. The result is always lossless, but may not be dependency preserving.
BCNF decomposition of R(A, B, C) with AB → C, C → B: start
Computed, not typed| A | B | C |
|---|---|---|
| a1 | b1 | c1 |
| a1 | b2 | c2 |
| a2 | b1 | c1 |
Step 0
Candidate keys: AB and AC. The dependency C → B has a left side C that is not a superkey: R is in 3NF (B is prime) but NOT in BCNF.
with and : violates BCNF ( is not a superkey). The pieces are and , both in BCNF and with the join equal to . But the dependency fits in neither piece: two tuples and in and , in each satisfy their own dependencies and yet join to two tuples that violate . A BCNF decomposition that preserves all dependencies does not always exist; this schema has none.
3NF synthesis
Algorithm.
- Compute a minimal cover of : right sides single attributes; no extraneous attribute in a left side; no redundant dependency. (Example: has the minimal cover .)
- For every distinct left side in create a relation .
- If no created relation contains a candidate key of , add a relation consisting of a candidate key.
- Remove relations contained in another.
The result is in 3NF and is both lossless and dependency preserving (checked on 300 random schemas). Example: with : the minimal cover is the set itself; the relations are , , ; the only candidate key is , which none of them contains, so is added. Result : lossless, preserving, and (here) also the result of the BCNF algorithm. (Computing a minimal cover: split the right sides, delete extraneous attributes from left sides by testing closures, then delete every dependency that the rest implies; the order of the deletions can lead to different, equally valid minimal covers.)
Summary of guarantees
| decomposition into | lossless | dependency preserving |
|---|---|---|
| BCNF (by the algorithm) | always | not always |
| 3NF (by synthesis) | always | always |
| any decomposition | must be tested | must be tested |
Worked examples
EX 1Binary test
Easy, into and : the common attribute determines : lossless. Into and : determines neither: lossy.
EX 2Dependency preservation
Easy, into : fits , fits : preserving. Into : fits , but fits neither piece and cannot be recovered ( gives nothing, because is not in ): not preserving, though lossless.
EX 3Chase with three pieces
MediumPieces , , with . Tableau rows: , , . sets row 1's to . sets to in rows 1 and 2. Row 1 is : lossless.
EX 4BCNF decomposition step by step
Medium, , key . Violation (closure of inside is ): split into and . has violating BCNF: split into and . has violating: split into and . Final pieces , , , : lossless, BCNF, and here also dependency preserving.
EX 5Typical questions
GATE level(a) "A decomposition of into and is lossless iff:" is a key of or of (more exactly determines one of them). (b) "A relation can always be decomposed into 3NF such that the decomposition is:" lossless and dependency preserving. (c) "BCNF decomposition is always:" lossless. (d) "The chase finds a row of all distinguished symbols:" the decomposition is lossless. (e) "Which dependency is lost when with , is decomposed into and ?" . (f) "Is a decomposition into and of ever lossless?" Only if determines one of the pieces (constants); normally lossy.
Cheat box
Cheat box
- Lossless: join of projections . Two pieces: or . General: chase for an all- row.
- Dependency preserving: every follows from dependencies inside the pieces (grow by ).
- Independent properties: all four combinations exist.
- BCNF decomposition: always lossless, may lose dependencies. 3NF synthesis: always lossless and preserving.
- Synthesis: minimal cover, one relation per left side, add a key if needed, drop contained relations.
Traps and GATE patterns
Connections
Builds on
Unlocks
Across subjects
No cross-subject links yet.
Within this subject
The normal forms that motivate decomposition are on the previous page; minimal covers are the subject of a later page (canonical cover and 3NF synthesis); redundancy that survives BCNF needs multivalued dependencies (4NF).
PYQs
7 previous year questions from your book. I re-solved each one myself (5 by running or simulating, 2 by reasoning only); the book's key is shown next to my answer. All PYQs
In the context of relational database normalization, which of the following statements is/are true?
- (a)It is always possible to obtain a dependency- preserving 3NF decomposition of a relation
- (b)It is always possible to obtain a dependency- preserving 1NF decomposition of a relation
- (c)It is not always possible to obtain a dependency- preserving BCNF decomposition of a relation
- (d)It is not always possible to obtain a dependency- preserving 2NF decomposition of a relation
Consider a relational schema team(name , city , owner)
with functional dependencies {name → city , name →
owner}
.
The relation team is decomposed into two relations,
DATABASE MANAGEMENT SYSTEM
t1(name , city) and t2(name , owner). Which of the
following statement(s) is/are TRUE?- (a)The relation team is NOT in BCNF.
- (b)The relations t1 and t2 are in BCNF.
- (c)The decomposition constitutes a lossless join.
- (d)The relation team is NOT in 3NF.
Consider the relation R(P, Q, S, T, X, Y, Z, W) with the following functional dependencies. PQ → X; P→YX ; Q→ Y; Y → ZW Consider the decomposition of the relation R into the constituent relations according to the following two decomposition schemes. DATABASE MANAGEMENT SYSTEM D1 : R=[(P, Q, S,T); (P,T, X); (Q,Y); (Y, Z,W)] D2 : R= [(P, Q,S); (T, X); (Q,Y); (Y,Z,W)] Which one of the following options is correct?
- (a)Both D1 and D2 are lossless decompositions.
- (b)Both D1 and D2 are lossy decompositions.
- (c)D1 is a lossless decomposition, but D2 is a lossy decomposition.
- (d)D1 is a lossy decomposition, but D2 is a lossless decomposition.
Let the set of functional dependencies F = {QR → S, R
→ P, S → Q} hold on a relation schema X = (PQRS).
X is not in BCNF. Suppose X is decomposed into two
schemas Y and Z, where Y = (PR) and Z = (QRS).
Consider the two statements given below.
I.
Both Y and Z are in BCNF
II.
Decomposition of X into Y and Z is dependency
preserving and lossless.
Which of the statements is/are correct ?- (a)I only
- (b)II only
- (c)Neither I nor II
- (d)Both I and II
Let R(A, B, C, D) be a relational schema with the
following functional dependencies:
F={A → B, B → C, C → D, D → B}
The decomposition of R into (A, B), (B, C), (B, D)- (a)gives a lossless join, and is dependency preserving
- (b)gives a lossless join, but is not dependency preserving
- (c)does not give a lossless join, but is dependency preserving
- (d)does not give a lossless join and is not dependency preserving
Which one of the following statements about normal forms is FALSE?
- (a)BCNF is stricter than 3NF
- (b)Lossless, dependency-preserving decomposition into 3NF is always possible
- (c)Lossless, dependency-preserving decomposition into BCNF is always possible
- (d)Any relation with two attributes is in BCNF
Let r be a relation instance with schema R = (A, B, C, D). We define r1 = πA,B,C (r) and r2 = πA,D (r). Let s = r1 ⋈ r2, where ⋈ denotes natural join. Given that the decomposition of r into r1 and r2 is lossy, which one of the following is TRUE?
- (a)s ⊂ r
- (b)r ∪ s = r
- (c)r ⊂ s
- (d)r ⋈ s = s
Self-check
Question 1
, , decomposition . Lossless? Dependency preserving?
Show answerHide
Not lossless (the pieces share no attribute; the join is a product with spurious tuples). Dependency preserving (each dependency lies inside a piece).
Question 2
What does the BCNF algorithm guarantee, and what not?
Show answerHide
Pieces in BCNF and a lossless join; not dependency preservation.
Question 3
In the chase, what symbol replaces what when two symbols in a column are equated?
Show answerHide
A distinguished symbol replaces a non-distinguished ; if both are 's, one is renamed to the other.
Question 4
3NF synthesis gives which two guarantees?
Show answerHide
A lossless join and dependency preservation (and every piece in 3NF).
Revision card
One-screen revision
- Lossless: or ; chase for several pieces.
- Preserving: every dependency of follows from the projected ones.
- BCNF algorithm: lossless, maybe loses dependencies. 3NF synthesis: lossless and preserving.
- Minimal cover one relation per left side add key relation remove contained ones.
References
- ·Silberschatz, Korth, Sudarshan, Database System Concepts (7th edition), Chapter 7, Sections 7.3 to 7.5 (decomposition using functional dependencies, algorithms for decomposition)
- ·Elmasri, Navathe, Fundamentals of Database Systems (7th edition), Chapter 15, Sections 15.2 to 15.5 (properties of relational decompositions, algorithms)
Verification
scripts/enum-checks/db_fd_check.py: on 400 random decompositions the binary lossless criterion equals the chase; when the chase fails, the final tableau read as a relation satisfies F, and the join of its projections contains the all-distinguished tuple, which is not in the relation (a constructed spurious tuple); when the chase succeeds, the join of the projections equals the relation for 8 random relations satisfying F each; the polynomial dependency-preservation test equals the brute-force test (union of the dependencies of F+ that fit in each piece implies F) on 500 random cases; the BCNF decomposition algorithm gives pieces in BCNF that are lossless on 300 random schemas, and 3NF synthesis gives 3NF pieces that are lossless and dependency preserving; the examples (lossy join with 4 tuples, the chase tableaux, the BCNF example that loses AB -> C, the synthesis result AB, BC, DE, AD) were recomputed. Textbook chapter references are from memory. SECOND PASS (2026-11-02, done by the assistant, not a human check): every Self-check question was solved before the printed answer was read and all agreed; the definitions, worked examples, cheat box and traps were read claim by claim and re-derived against the textbook definitions and the sample database. DEFECT FOUND AND FIXED: a reference to a page that is not built was replaced by a short description of the minimal cover steps. Status raised to self-checked; verified needs a textbook or human check.
last verified: never
My notes (saved in this browser)