why design is good ?
Otherwise ,a larger alternative(schema) may cause:
1)redundancy
2)update may cause inconsistency
3)update may bring nulls
So,how do we make a smaller alternative(schema)?
It is impossible to divide a larger schema into a smaller one by means of finding repetition caused by join(why impossible? large amount of data and unknown of relations int the real world).
What matters is the the functional dependency(the rules in the real world).
On the other hand,a smaller alternative(schema) may cause:
1) lossy decomposition.which means when you decompose relation X,getting Y&Z.You will find Y join Z !=X.
atomic if elements of the domain are considered to be indivisible units.
a relation schema R is in first normal form (1NF) if the domains of all attributes of R are atomic.
Discuss in whether cs0114 is an atomic domain.
Recall notation
1)Roman letter stands for a relation set while Greek letter for other attribute set(always one attribute).
2)K is a super-key of r (R).(candidate key is a minimal super-key )
3)we use single lowercase letter in our definitions and algorithms,not for eg. Instructor.
4)instance of r means a particular value at some given time.
Define :relations have feature of functions .
we say that the instance satisfies the functional Dependency
We say that the functional dependency alpha→beta holds on schema r (R)
a functional dependency of the form alpha→beta is trivial if beta ?alpha .
Some times alpha!->beta but alpha,gamma->beta.
notation F+ to denote the closure of the set F,
Boyce–Codd normal form (BCNF) eliminates all redundancy that can be discovered based on functional dependencies.
Formal definition
for all functional dependencies in F+ of the form alpha → beta, where alpha? R and beta ? R, at least one of the following holds:
? alpha→ beta is a trivial functional dependency (that is, beta ?alpha ).
? alpha is a super-key for schema R.
In other words,BCNF requires that all nontrivial dependencies be of the form α→β , where α is a superkey.
Decomposition rules: divide R into:
? (α ∪ β)
? (R ? (β?α ))
About testing constrains.
in some cases, decomposition into BCNF can prevent efficient testing of certain functional dependencies.
When a dependency whose attributes do not all appear in any one schema we call it is not dependency preserving.
BCNF is not dependency preserving but 3rdNF is.
second normal form is of historical significance only and is not used in practice.
BCNF requires that all nontrivial dependencies be of the form α→β , where α is a superkey.
Third normal form (3NF) relaxes this constraint slightly by allowing certain nontrivial functional dependencies whose left side is not a superkey.
[Database.System.Concepts(6th.Edition.2010)].Abraham.Silberschatz. Ch8学习笔记
原文:https://www.cnblogs.com/SuuT/p/9984414.html