home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases
- Path: sparky!uunet!mcsun!Germany.EU.net!ira.uka.de!chx400!bernina!neptune!nugget.inf.ethz.ch!marti
- From: marti@nugget.inf.ethz.ch (Robert Marti)
- Subject: Re: Normalizing 2NF -> 3NF
- Message-ID: <1992Nov16.103334.15543@neptune.inf.ethz.ch>
- Sender: news@neptune.inf.ethz.ch (Mr News)
- Nntp-Posting-Host: nugget.inf.ethz.ch
- Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
- References: <1992Nov15.163413.17527@news.uiowa.edu> <1992Nov15.223825.16263@odin.diku.dk>
- Date: Mon, 16 Nov 1992 10:33:34 GMT
- Lines: 43
-
- In article <1992Nov15.223825.16263@odin.diku.dk>, elgaard@diku.dk
- (Niels Elgaard Larsen) writes:
- |> bonak@herky.cs.uiowa.edu (Esmail Bonakdarian) writes:
- |> >E.g., given a relation with three attributes, A, B, and C, where
- |> >attribute A is the PK, the following dependencies exist:
- |> > R(A* ,B ,C)
- |> > A -> B
- |> > B -> C
- |> >i.e, A determines B, and B in turn determines C.
- |> >3NF would split this up into two relations:
- |> > R'(A*,B)
- |> > and
- |> > R"(A*,C) OR R"(B*,C)
- |> >Which of these two latter relations is the "correct" one according to
- |> >the theory? Or does it always depend on the given semantics of the data
- |> >being modeled? It seems to me that I've seen both.
- |>
- |> Both are correct since both (A,C) and (B,C) are on 3NF. That does of course
- |> not mean that they are equally good. Depends on the queries on the database.
-
- [note that I have slightly edited the original posting to conserve space]
-
- In the following, I assume that the functional dependency (FD)
- B -> A does _not_ hold, since if it did, no normalization would
- have been necessary in the first place.
-
- I haven't been looking at the theory books (Maier, Ullman) in a
- loooong time, but the solution with R'(A*,B) and R"(B*,C) is much
- better than the other one with R'(A*,B) and R"(A*,C). Why? Well,
- if you perceive an FD B -> C in the real world, you probably would
- like your system to enforce this integrity constraint. (FDs and
- MVDs are really just special cases of integrity constraints.) The
- simplest (and in some systems still the _only_) way to enforce an
- FD is to make its left hand side a key for a relation consisting of
- the attributes listed on both its left and right hand side. (In
- older SQL-based systems, this has to be done by CREATing a UNIQUE
- INDEX for column B of table R".)
-
- --
- Robert Marti | Phone: +41 1 254 72 60
- Informationssysteme | FAX: +41 1 262 39 73
- ETH-Zentrum | E-Mail: marti@inf.ethz.ch
- CH-8092 Zurich, Switzerland |
-