Dependence

advertisement
Dependence
1. from primary key to super key
a. Primary key
b. Candidate key
c. Super key
2. Functional dependence
a. Domain: a set of attributes
b. Codomain: a set of attributes
c. Terms: determinant vs. dependent
d. Interpretation: XY
For each instant of a relation, two tuples agrees on X values implu agree
on Y
e. Trivial: Y is a subset of X ( projection)
f. Note: if X is not a candidate key, we have redundancy on Y.
3. S+=Closure of S
a. Use composition
b. If it is not easy to find S+
c. Work on a lesser problem w/o having S+
4. Find all attributes that are dependent on Z ( a set of attributes.)
i. Inference rules ( see later)
ii. Algorithm
iii. Ex: find all attributes of {A,B} that are dependent on: ABC;
ECF; BE; CDEF Ans: {ABCDF} : call it AB+
iv. Benefits:
1. superkey
2. given XY how do we know it belongs to S+ w/o
knowing S+ (check if Y is a subset of X+
5. Inference rules
a. Reflexive
b. Augmentation
c. Transitivity
d. Self determination
e. Decomposition
f. Union
g. Composition
h. General Unification Theorem: If AB and CD then A union (C-B)
BD
6. Irreducible sets
a. Cover: S2 cover S1 if S1* is a subset of S2*
b. S1 and S2 cover each other: they are equivalent.
c. Given S, we might have many of its equivalents. Which one we want to
select as a representative? Ans: the one with the following properties:
i. Right hand of each FD must be ONE attribute
ii. Left hand side can not be reduced w/o changing S*
iii. No FD’s can be discarded w/o changing S*
d. Given an S, can we find its representative?
i. Yes
ii. Its representaive is called IRREDUCIBLE.
Download