Here is a question that was thrown to me recently, given a relation schema R = {A,B,C,D,E,G}
and with a set of FDs on R, F = {DG -> AE, G -> C, BG -> AE, D -> CG}
, is any BCNF decomposition that is lossless and dependency-preserving?
I tried different BCNF decompositions on the relation R, but I could not find a satisfiable decomposition.
Hence, I attempted to create a 3NF schema using Bernstein's Synthesis algorithm. I had computed the minimal cover to be F'= {BG -> A, BG -> E, G -> C, D -> G, D -> E, D -> A}
. And from here, I just broke it up into smaller schemas: {BGA}, {BGE}, {GC}, {DG}, {DE}, {DA}
.
But isn't this in BCNF? If it is in BCNF, it looks to be lossless and dependency preserving as well. I have checked for the preservation of dependencies by using the functional dependency closure, F+. Everything seems legitimate. Even after discussing with my classmates, we are all confused as to why it is such.
I was taught that the BCNF decomposition which I am using: find a violating FD in F that holds in R and remove it, would be able to find a valid decomposition that is both lossless and dependency preserving if there is one. I believe I followed the steps clearly, so the 3NF schema I computed should be correct. As for the BCNF decomposition, I followed the algorithm to the book, which is find the violating FD and make it a sub relation, and keep only the determinant of the FD in the leftover relation and repeat. But I could not arrived the schema: {BGA}, {BGE}, {GC}, {DG}, {DE}, {DA}
.
So the question I have is why am I able to find a satisfactory BCNF decomposition using the synthesis algorithm, where the decomposition is just the minimal cover, yet I am unable to do it using the textbook decomposition algorithm? (Assuming all the steps I took are correct)
Edit: this is a link to the BCNF steps