normalization - co-ordinating primary keys in separate tables

Olga W

Board Regular
Joined
Jun 16, 2010
Messages
53
I've been running in circles with the design of my database for about a month now.

It's a database to store the details of all our company's contacts. Different fields apply to different groups. We need to know different peices of information about potential donors, staff, lawyers, suppliers etcetera.

Because of that I should probably store the differnet types of contact in separate tables with distinct fields.

BUT.... I need to be able to amalgamate records from any of these tables, so there can't be any duplicate primary key values between the tables. But even if I enforce referential integrity with cascade updating and deletion, the autonumbers of separate tables don't co-ordinate with each other; and if I turn off auto-number I leave users to guess at safe primary key values, which is no good, I don't even want them to see the primary key values anyway.

I thought about having a simple All_Contacts table (just containing name fields, and maybe other universally applicable fields), joined in a many to many relationship with a Relevance_to_us table, as one contact might fall under more than one category of relevance. But then I still need tables storing the additional information fields associated with each category of relevance, and I fall back into the problem of not being able to co-ordinate the auto-number primary key fields.

About a week ago I decided there was no problem just having one contact table with ALL the fields relevant to any contact. And that the many blank fields didn't matter since the data is only ever accessed via forms, and I can divide up the contacts and select out the appropriate fields at the point of form creation. This all seemed fine and dandy, until I started reading more articles on data normalisation on friday night. According to what I've read that model clearly violates the rules of normalisation. I still haven't fully understood how it would lead to deletion, update and insertion anomolies...

But anyway, any help?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If you have a small db that will only have limited circulation doing the everything in one table scenario can work. You will find issues with queries and reports and knowing which fields to show and so forth this way however.

You can have a single Contact table with the universal data in it. Also an extra field holding ContactType (doctor, lawyer, etc). Based on this field you can then know which query, subform, report et al to show. There will be a separate table for each type linked back to the main form. The big issue there is what to do when changing types as this can orphan a row in the previous table.

Either way has issues, I prefer the last one.

hth,

Rich
 
Upvote 0

Forum statistics

Threads
1,214,956
Messages
6,122,465
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top