I've thought I had a decent understanding of database normalization but I've come across a fairly simple problem that I'm having difficulty resolving.
I have a database which I use to track submittals from companies.
Originally it was set up as follows:
tblCompany
Company_ID (PK)
Company (No duplicates allowed)
tblSubmittals
Submittals_ID (PK)
Description
Date
Company_ID (FK)
Now I've decided that I want to add a contacts table with fields such as first name, last name, company, etc. My dilemma is that in the Submittals table I need to keep track of which company the submittal is from but I don't care WHO it is from.
So I created another table as follows:
tblContacts
Contact_ID (PK)
Company_ID (FK)
First_Name
Last_Name
This will work except that when I add a new contact I will have to add code to see if the company exists in the tblCompany before I add it.
It doesn't seem like this would be the correct way to set this up because I'm adding the same data to 2 different tables.
I'm sorry if this seems like a stupid question. Thanks for your input.
I have a database which I use to track submittals from companies.
Originally it was set up as follows:
tblCompany
Company_ID (PK)
Company (No duplicates allowed)
tblSubmittals
Submittals_ID (PK)
Description
Date
Company_ID (FK)
Now I've decided that I want to add a contacts table with fields such as first name, last name, company, etc. My dilemma is that in the Submittals table I need to keep track of which company the submittal is from but I don't care WHO it is from.
So I created another table as follows:
tblContacts
Contact_ID (PK)
Company_ID (FK)
First_Name
Last_Name
This will work except that when I add a new contact I will have to add code to see if the company exists in the tblCompany before I add it.
It doesn't seem like this would be the correct way to set this up because I'm adding the same data to 2 different tables.
I'm sorry if this seems like a stupid question. Thanks for your input.