home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / 8028 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  3.1 KB

  1. Path: sparky!uunet!portal!cup.portal.com!DVaz
  2. From: DVaz@cup.portal.com (David D Vazquez)
  3. Newsgroups: comp.databases
  4. Subject: Re: Normalizing 2NF -> 3NF
  5. Message-ID: <70064@cup.portal.com>
  6. Date: Sun, 22 Nov 92 16:56:09 PST
  7. Organization: The Portal System (TM)
  8. Distribution: world
  9. References: <1992Nov16.103334.15543@neptune.inf.ethz.ch>
  10.   <1992Nov16.135135.3108@odin.diku.dk> <69674@cup.portal.com>
  11.   <1ejt9qINN340@hrd769.brooks.af.mil>
  12. Lines: 61
  13.  
  14. Dave Burges writes:
  15.  
  16. >  One of the references I use when I teach this course (Mary E.S. Loomis) says
  17. :
  18. >"A relation is in 'third normal form' if, and only if, it is in 2NF and no 
  19. >non-key attribute is ''transitively dependent'' on the primary key."
  20. >
  21.  
  22. Exact definition I learned for 3NF.
  23.  
  24. >  A Student/Dormitory relationships might be a good example of the original 
  25. >question.  R1(A,B,C) == (Student Name, Dorm, Dorm Address), where every
  26. >student has a room in a dormitory.  The Address of the dorm is Functionally
  27. >Dependent on the Dormitory (yes, or vice versa, it's only an example), not
  28. >the student name.  In addition, every student is in a dorm.  This relation
  29. >is NOT in 3NF.  The dependency between R1(A) and R1(C) is transitive (at best)
  30. >based on the value of R1(B).
  31. >
  32. >|
  33. >|It may make that specific query faster, but it can wind up costing you more
  34. >|disk space.  While R1(A*,B) and R2(A*,C) are in 3NF given the above stated FD
  35. s
  36. >,
  37. >|you will have alot of redundant (repeated) data (3NF is supposed to solve thi
  38. s
  39. >|correct?).
  40. >|
  41. >
  42. >  Where is the redundancy?  In the foreign key element?  That is where your
  43. >cardinality will help determine the actual implementation, but we are talking
  44. >Form Normalization, not implementation.  In normalization, the concepts of 
  45. >query speed and disk space have no place.  Save them for the physical
  46. >implementation phase.
  47. >
  48.  
  49. I agree, but physically implemented tables generally tend to look alot like 
  50. their abstractly designed  relatives.   You can also save alot of time and
  51. headaches if you implement your tables just like they've been designed.  Just
  52. think, you've spent 7 hours designing a database only to have your programmer/
  53. implementor spend another 7 hours trying to figure out the better implementa-
  54. tion (and for something silly like R1(A*,B)/R2(A*,C) vs. R1(A*,B)/R2(B*,C).
  55. The database implementor shouldn't have to make these kinds of decisions!  
  56. Supertype/subtype and recursive relationship implementation should be the exten
  57. t
  58. of implementation issues.
  59.  
  60. 'Redundancy?', you ask.  Given R(Student, Dorm, Dorm Address); if you implement
  61. as R1(Student, Dorm) and R2(Student, Dorm Address), you are repeating values
  62. of Dorm Address for each student as well as not enforcing Dorm -> Dorm Address
  63. (or vice versa); you'd have to do some extra coding..  Also, you'd need two
  64. copies of Student's names (one to find the dorm and one to find the dorm's 
  65. address); this is a waste.
  66.  
  67. The problem I see is that you never have one correct answer when it comes to
  68. getting a database into 3NF.  Should there be one, maybe?
  69.  
  70. >TSgt Dave Burgess
  71. >NCOIC, AL/MIS
  72. >Brooks AFB, TX
  73.  
  74.   -Dave. "dvaz@cup.portal.com and dvazquez@sdiserv.cs.uno.edu"
  75.