1
RECAP
So far we have seen:
- How to use functional dependencies to
guide the design of relations
- How to modify/decompose relations to
achieve 1NF, 2NF and 3NF relations
2
But
- How do we make sure the decompositions
are lossless (equivalence preserving)?
- Are some decompositions better than
- thers?
- What if there are multiple candidate keys?
3
Why is losslessness important?
- No information is lost or added implicitly by
mistake.
- Any information that can be derived from the
- riginal relation can also be derived from the
relations that result from the decomposition and vice versa.
- In other words, you get the same answers to your
queries.
4
An Instance of Relation NEWS
S# SNAME STATUS CITY S1 Smith 20 London S2 Jones 10 Paris S3 Blake 10 Paris S4 Clark 20 London S5 Adams 30 Athens
5
Suppose we decompose NEWS into:
NEWS (S#, SNAME, STATUS, CITY)
CITY → → → → STATUS S# → → → → SNAME, STATUS, CITY
R1(S#, Sname) R2(City, Status)
So no attributes are lost.
6