Sunday, February 19, 2012

database design - keys

You may also want to consider this:
Do you have any manufacturers that manufacture more than
one piece of equipment found in the Equipment table?
This is usually the case. You may want to use some
unique identifier per Manufacturer, and add the
maufacturer's ID field to the Equipment table.
This could get even trickier since you may have mulitple
manufacturer's supplying multiple types of equipment, in
which case you may want to create a third table which
would have fields for the Manufacturer ID and the
Equipment ID to implement the many to many relationship.
Just a couple of thoughts.
Matthew Bando
matthew.bando@.CSCTGI(remove this).com
quote:

>--Original Message--
>Hello All
>I am designing a database, or rather redesigning a very

old database and
quote:

>have a question regarding setting up key fields. The

old database has a
quote:

>table called Equipment with two fields:
>Equipment Code - text 8
>Equipment Description - text 50
>In the new design I will have a table called

Manufacturers that will have an
quote:

>Equipment Code field, which will link to the Equipment

table to get the
quote:

>description. My question is, should I make a new

Integer key field called
quote:

>say EquipID which is what would get stored in the

Manufacturers table or
quote:

>should I simply use the Equipment Code field as the

key? What are the
quote:

>advantages/disadvantages to each method?
>I have several other tables with a similar situation

where the 'Code' is
quote:

>unique but there are more fields in these tables.
>Thanks,
>Gerry
>
>.
>
Thanks Matthew.
At this point, there will only be one equipment code for one manufacturer.
Although I am having meetings next week which will confirm this. The old
database had one-to-one but anytime you update a program or database then
that is the time to think about such things. Perhaps they don't know the
possibilities after having used a paradox database for 12 years!
Gerry
"Matthew Bando" <anonymous@.discussions.microsoft.com> wrote in message
news:740c01c3e738$180f8140$a401280a@.phx.gbl...[QUOTE]
> You may also want to consider this:
> Do you have any manufacturers that manufacture more than
> one piece of equipment found in the Equipment table?
> This is usually the case. You may want to use some
> unique identifier per Manufacturer, and add the
> maufacturer's ID field to the Equipment table.
> This could get even trickier since you may have mulitple
> manufacturer's supplying multiple types of equipment, in
> which case you may want to create a third table which
> would have fields for the Manufacturer ID and the
> Equipment ID to implement the many to many relationship.
> Just a couple of thoughts.
> Matthew Bando
> matthew.bando@.CSCTGI(remove this).com
>
> old database and
> old database has a
> Manufacturers that will have an
> table to get the
> Integer key field called
> Manufacturers table or
> key? What are the
> where the 'Code' is

No comments:

Post a Comment