Consider the schema S=(A,B,C,D) having AB as primary key, and the following functional dependencies (FD) hold on it: AB --> C, AB --> D, BC --> D. Is the following decomposition in Boyce-Codd Normal Form (BCNF)? S1=(A,B,D) & S2=(B,C,D)
Attempted answer which probably misses something: Using the given FDs, in S1 the key is AB; in S2 the key is BC. S1 contains the FD AB-->D, and its left hand side contains its key, AB. S2 contains the FD BC-->D, and its left hand side contains its key, BC. Hence, it seems that the decomposition is in BCNF.
However, we know that BCNF decompositions are lossless, and this one is not. The common attributes are {B,D} and its closure is still {B,D}.
Where is the bug then?