Semantics of attributes
Attribute belonging to one relation have certain
real world meaning and proper interpretation
associated with it
The ease with which the meaning of relations
attribute can be explained is an informal measure
of how well relation is designed.
Guideline 1
Design a relation schema so that it is easy to
explain its meaning.
Do not combine attributes from multiple entity
types and relationship types into single relation.
Update Anomalies
Another serious issue of combining two relation
like in previous slide is update anomalies
Insertion Anomalies: of two types
To insert new employee into EMP_DEPT who
works in department 5, we must have to insert all
values of dept 5 correctly so that they are
consistent with values of other tuples. While in
separate employee and department we dont
have to worry about this, as only department no
is to be entered and record will be matched by
department.
It is difficult to insert new department in
EMP_DEPTwhich has no employee associated with
it yet. the only way is to place NULL values in
attribute of employee. Problem will be SSn is a
Update Anomalies
Guideline 2
Guideline 3
Suppose we divide
Guideline 4
Summary of guidelines
Design a relation schema so that it is easy to
explain its meaning. Do not combine attributes
from multiple entity types and relationship types
into single relation.
Design a relation so that no update anomalies are
present.
Avoid placing attributes in a base relation whose
value may frequently be absent( avoid NULL
values)
Generation of spurious tuples during join on
improperly related relations.
Functional Dependencies
A FDX
such that for any two
Y t and t in r that have t [X] =
tuples
1
2
1
t2[X], they must also have t1[Y] =
t2[Y].
Value of Y component of a tuple in r
depend on values of the X
component .
So X functionally determines Y in a
relation schema R if and only if two
X
Y
tuples
of r agree on their
X-value,
Y
X
they must necessarily agree on their
Functional Dependencies
A FD is a property of semantics or
meaning of the attributes.
Normalization
Not in 1NF
Disadvantage: redundancy
Some definitions
Some definitions
A functional dependencyX
is a full
functional dependency
if removal of any
Y
attribute A from X means that dependency
does not hold any more: i.e, for any attribute A
X, (X-{A}) does not functionally determine Y.
So Functional dependency
is a partial
X
dependency if some attribute
A X can be
Y
removed from X and dependency
still holds.
{Ssn, Pnumber}
Hours is full dependency
but {Ssn, Pnumber}
Ename is not as Ssn
Ename holds.
Ssn
Dnumber and Dnumber
Dmgr_ssn
So Ssn
Dmgr_ssn
End of chapter 7