|
-
Jul 23rd, 2003, 09:09 AM
#1
Thread Starter
Fanatic Member
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,
-
Jul 23rd, 2003, 09:32 AM
#2
Frenzied Member
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.
-
Jul 23rd, 2003, 10:58 AM
#3
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|