home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / 7874 < prev    next >
Encoding:
Text File  |  1992-11-15  |  2.5 KB  |  56 lines

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