The book is also strange enough, the front righteous told a decomposition method of bcnf and then said that this method is not sufficient ... Well, I'll be lecturing.
According to the contents of note 10, and then split a non-bcnf data table, we have said that the discovery function depends on LA (a)->la (b) does not conform to BCNF, the correct practice is to take La (a), La (b) to open a table, and then R-la (a) +la (b) Make a second table.
But can the new table meet BCNF? Not necessarily, but it's at least a little closer:
Let's take a look at the following example:
There are R (A,b,c,d,e), with F:a->b,bc->d.,
Then it is clear that a->b is not in accordance with the definition of bcnf (in fact, there is a problem with this statement, and later
Then split, become: R1 (A, B) R2 (ACDE), and then we found that the BC is not related to the R2, according to the previous statement, this split is complete.
But not yet.
By F can be introduced ac->d, so R2 is still not a bcnf relationship.
What is the problem? The problem is that every time you split a table, the fnew in the table should be f+ with the unpacked part, so that's the real concept split, and this time we have to go back to the bcnf conceptual question:
What is the concept of bcnf?
For each function dependency that exists in f+ , it must meet one of the following two conditions:
1. This function dependency is self-directed (unimportant trivial)
2. For the dependent La (a)->la (b), La (a) is a super-key for the relationship.
The embarrassing thing happened because, according to the example in the book, I could propose a r (a,b,c,d,e), A->B,B->CDE.
We can push that a is a super-key to the relationship, but this super-key is given by f+, not directly from the function.
(or obtain a A +
Therefore, for any split, because it involves the concept of a super-key, and does not calculate f+ or a can not get its super-key, so a substitution of the discriminant algorithm is:
Calculate the f+
The function dependency of any split-derived schema is based on f+, so the function that exists in the f+ is dependent on the left side, the maximum right end of the function depends on it, and then determine whether it has been split (is not established) if there is no split, then split processing, if split, it is not processed.
Or you can directly obtain the entire array of attributes, and then to each arrangement to find its closure, if the closure, and the closure is not (R-Closure source attribute set), then this dependency exists and does not meet BCNF, split, the process is almost the same as the previous.
The method of 3NF
Obtain FC
For each function in FC La (a)->la (b) Create a table La (a) La (b)
For any candidate keys, if none of the tables created above contain them, a new table is created, and the attribute is the candidate key
For any one of the above-mentioned tables, the two-tuple, a, a, if a is a subset of B, delete A and if B is a subset, then delete B until nothing can be deleted.
Returns the result.
Database Learning Note 13_decomposition of Bcnf Ultimate version