Two primary keys in teh same table

D

David

I have a list of companies and a list of analysts who do
research on the companies. The analysts have names
addreesses etc

I have imported two tables from Excel to Access. One is
the list of companies with several fields including the
names of the analysts who cover the companies Analyst1,
Analyst 2 etc. The other is the list of companies

I am trying to link the Analyst field in the Comapnies
list to the Analyst names etc but Access will not allow
it.

How does one create athird table with two primary keys so
I can link the two tables

The two tables look like this:

Table 1

Company - primary key
Type
Category
Analyst1
Analyst2
Analyst3

Table 2

Analyst - Primary Key
Compoany
Phone Number
Email
Address

Any help would be much appreciated
 
R

Rick Allison

What you have is a normalization issue. Anytime you see "buckets"
Analysis1, 2, 3, etc. that is a red flag for de-normalization.

What I am seeing is more along the lines of this.
CompanyID - primary key
Type
Category
AnalystID
Phone Number
Email
Address

And a new table

CompanyID
AnalystID

This is a many to many relationship. Meaning, an analyst can work for any
company and a company can have any analyst work for it.

So
CompanyID | Type | Category | Name
C1
C2
C3

AnalystID | Phone | email | Address
A1
A2
A3

CompanyID | AnalystID
C1 A1
C1 A2
C2 A1

The many to many table is managed by code. Some business rule or a form.

That's my take on your question. Good luck
 

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