home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!mica.inel.gov!ux1!news.byu.edu!gatech!usenet.ins.cwru.edu!agate!doc.ic.ac.uk!uknet!mcsun!sunic!dkuug!diku!elgaard
- From: elgaard@diku.dk (Niels Elgaard Larsen)
- Newsgroups: comp.databases
- Subject: Re: Normalizing 2NF -> 3NF
- Message-ID: <1992Nov16.135135.3108@odin.diku.dk>
- Date: 16 Nov 92 13:51:35 GMT
- References: <1992Nov15.163413.17527@news.uiowa.edu> <1992Nov15.223825.16263@odin.diku.dk> <1992Nov16.103334.15543@neptune.inf.ethz.ch>
- Sender: elgaard@trud.diku.dk
- Organization: Department of Computer Science, U of Copenhagen
- Lines: 51
-
- marti@nugget.inf.ethz.ch (Robert Marti) writes:
-
- >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".)
-
- Yes, but this might not be efficient. Fx, if there are two groups of users
- that wants to see an (A,B) and an (A,C) view resp., it requires a lot of
- unnecessary joins. Eg, (A,B,C) == (Name,Address,Phone#). You typically look up
- addresses from names and phone-numbers from names---not phone# from addresses.
-
- A DBMS should be able to check other integrity constraints than primary keys.
- --
- Niels Elgaard Larsen
- Institute of Computer Science,
- University of Copenhagen
- E-mail: elgaard@diku.dk
-