Results 1 to 3 of 3

Thread: DB Design - Table layout

  1. #1

    Thread Starter
    Fanatic Member aconybeare's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    772

    DB Design - Table layout

    I have an oracle database, which is currently structured as follows -

    Code:
    LOBusiness (Parent - Top level) 1 To many with Division
      Division  1 To many with building, KBP etc...
        Building
        KBProcess
        Risk 
        ETC...
    I have received a request to include subDivisions beneath divisions
    Code:
    LOBusiness (Parent - Top level) 1 To many with Division
      Division  0 or 1 To many with SubDivision (if  no subdivisions 1 To Many with Building, KBP etc...)
        SubDivision 1 To Many with Building, KBP etc...
          Building
          KBProcess
          Risk 
          ETC...
    Simple enough, however some divisions don't have subDivisions
    Does anyone have any advice, tips or tutorials on how to achieve this?

    Hopefully this makes sense, however If not please let me know and I'll try and word it better.

    Cheers,

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Make subdivision a repeating table (1 to many) for division.
    Keep the same table hierarchy you have.

    You're over-normalizing and will get yourself into trouble.
    Just add the fields you need to identify Division & subduivsion, ie. change the primary key to Division + subdivision (allow null subdivisions).

    Keep the actual subdivision names, other stuff in a separate subdivision table for lookups. Add the same key to all of the child tables, use the same key for subdivisions.

    Ie., some buildings will have several subdivisions and so on, some buildings will have no subdivisions, but you can reach all child records.

    This will mean some more records in Buildings and so on.

  3. #3

    Thread Starter
    Fanatic Member aconybeare's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    772
    Thanks Jim,

    Sounds good, I will give it my best shot, may come back with one or two questions.

    Many thanks for your help

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width