question re: primary key

G

Guest

Hi everyone,

I have a list of customer ID #s that are unique to each company, however,
some companies have different locations with unique location numbers. For
example:

Company A, ID 10001, Seattle, Location Code 1
Company A, ID 10001, London, Location Code 99
Company B, ID 10002, Tokyo, Location Code 1
Company C, ID 10003, Cairo, Location Code 1
Company C, ID 10003, Lima, Location Code 99

So, the data combination of company ID and ship code is always unique (10001
and 1, 10001 and 99, 10002 and 1).

I'd like to rely on the experience of folks on this board. Am I best off to
just go ahead and set an unique autonumbered primary key, or should I go with
the company ID and have a company detail table that supplies the location
info?

Thanks,

Zambi
 
S

Smartin

Zambi said:
Hi everyone,

I have a list of customer ID #s that are unique to each company, however,
some companies have different locations with unique location numbers. For
example:

Company A, ID 10001, Seattle, Location Code 1
Company A, ID 10001, London, Location Code 99
Company B, ID 10002, Tokyo, Location Code 1
Company C, ID 10003, Cairo, Location Code 1
Company C, ID 10003, Lima, Location Code 99

So, the data combination of company ID and ship code is always unique (10001
and 1, 10001 and 99, 10002 and 1).

I'd like to rely on the experience of folks on this board. Am I best off to
just go ahead and set an unique autonumbered primary key, or should I go with
the company ID and have a company detail table that supplies the location
info?

Thanks,

Zambi

The fact that you suggest "company detail table" infers that you might
want to store more information specific to each location.

If this is the case set up a two tables with a 1:many relationship
between the Company and Location tables.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top