2 tables better than 1?

LeBron

Registered User.
Local time
Today, 14:07
Joined
May 29, 2009
Messages
17
Bear with me, I'm new to Access...

I'm creating a database of companies and 1 or 2 key contacts at those companies - started the process in Excel and ready to import into Access. Since I have multiple contacts for certain companies, the formatting of certain fields isn't good - what looks OK in Excel, having multiple names in a single cell for example, doesn't look OK in Access. And doesn't align with another field, email addresses.

Is the easiest way to create one table just for the companies ie. company name, website, description, and one table for the contact people? And, have one row per contact person in Excel to make it easier to import?

Can the primary key be the organization name, or will that prove problematic when I have more than one record in the "contact people" table for the same organization ie. same primary key?

Is there another way around this?
 
If there are multiple instances of people within companies, then yes, that's a good reason to have a companies table and a separate contacts table.

It's possible for more than one organisation to coincidentally be named the same (at least in simple, everyday terms) - best just use an autonumber for the company primary key, then use that as a foreign key (stored as a number, not autonumber) in the contacts table.
 
Thanks very much. In this case I'm sure there won't be any duplicate company names - in that case can I use the company name as the primary key? Obviously there are more than one employee per company, in the employee table.
 
You can use the company name for the primary key, but you really shouldn't. Meaningful primary keys often come back to bite you later - if, for example, the company changes name, or if (I know you said you're sure it couldn't happen, but that kind of certainty can be tested by real-world complexities) two companies both decide to call themselves 'U Need Us', or something like that.

A meaningless autonumber primary ID, plus a text field for company name is better (in my opinion). You can always configure your reports. forms, etc to use the autonumber key, but display the meaningful text.
 

Users who are viewing this thread

Back
Top Bottom