Dear Experts,
I need your advice on a Foreign Key issue, let me explain with an example.
I have set up the following 3 tables:
EmployeeT
EmployeeID PK 1
FirstNameID FK Ward
MiddleNameID FK
LastNameID FK Peters
PreferredNameID FK Warre
FirstNameT
FirstNameID PK
FirstName
LastNameT
LastNameID PK
LastName
I haven't setup separate tables for MiddleName and PreferredName, instead I opted to created a relationship for each with FirstNameT.FirstNameID and pick a first name there. For example employee Ward (first name) prefers to be called Warre.
However, not every employee has a preferred name or a middle name.
What's the best way to set it up in a table? I created a relation so the for the other employees who don't have a middle name or preferred name the system asks for a value? But I can't set my Foreign key to null, that not correct.
Can you please shed a light?
Thanks.
Best regards,
Siegfried
I need your advice on a Foreign Key issue, let me explain with an example.
I have set up the following 3 tables:
EmployeeT
EmployeeID PK 1
FirstNameID FK Ward
MiddleNameID FK
LastNameID FK Peters
PreferredNameID FK Warre
FirstNameT
FirstNameID PK
FirstName
LastNameT
LastNameID PK
LastName
I haven't setup separate tables for MiddleName and PreferredName, instead I opted to created a relationship for each with FirstNameT.FirstNameID and pick a first name there. For example employee Ward (first name) prefers to be called Warre.
However, not every employee has a preferred name or a middle name.
What's the best way to set it up in a table? I created a relation so the for the other employees who don't have a middle name or preferred name the system asks for a value? But I can't set my Foreign key to null, that not correct.
Can you please shed a light?
Thanks.
Best regards,
Siegfried
Last edited: