B
Ben
Hi group-
I am working on re-designing a database structure. My goal is to normalize
the structure to more easily allow for future development. Additionally, I
have to do this for Access, SQL and Oracle.
Anyway, here's what I'm wondering - what are best practices for handling
similar entities? For example, my database has people and companies. Both
can have many similar attributes in one to many or many to many
relationships, e.g. they both can have multiple phone numbers and addresses,
two people could have the same phone number and address, an address could be
for a person and a home business etc. At the same time, there are enough
different attributes that each needs it's own table.
So, my current notion is to this: the person and company primary keys are
identity fields. If I increment them each by 2 but start with 1 and 2 the PK
for people would be odd and the PK for company would be even (also w/ a
constraint just for safety). Now the PK values are unique across both
tables. It seems that the joins would work out very well when querying
against one or both tables. Are there any gotcha's with this type of design?
(I am fairly confident that the number of rows in either tables will not
exeed half an integer value).
TIA for any thoughts
Ben
I am working on re-designing a database structure. My goal is to normalize
the structure to more easily allow for future development. Additionally, I
have to do this for Access, SQL and Oracle.
Anyway, here's what I'm wondering - what are best practices for handling
similar entities? For example, my database has people and companies. Both
can have many similar attributes in one to many or many to many
relationships, e.g. they both can have multiple phone numbers and addresses,
two people could have the same phone number and address, an address could be
for a person and a home business etc. At the same time, there are enough
different attributes that each needs it's own table.
So, my current notion is to this: the person and company primary keys are
identity fields. If I increment them each by 2 but start with 1 and 2 the PK
for people would be odd and the PK for company would be even (also w/ a
constraint just for safety). Now the PK values are unique across both
tables. It seems that the joins would work out very well when querying
against one or both tables. Are there any gotcha's with this type of design?
(I am fairly confident that the number of rows in either tables will not
exeed half an integer value).
TIA for any thoughts
Ben