MikeG wrote:
Does this mean that the ClerkID in the Clerk table will always be an identical match to the EmployeeID in the Employee table?
Exactly.
MikeG wrote:
For example, if I have a record in the Employee table which has an EmployeeID of 5, and then created a Clerk record, would the ClerkID also be 5? Is that the intention?
Yes.
MikeG wrote:
Is this also a valid way:
Employee Table:
EmployeeID PK int autonumber
FirstName varchar Unique
Clerk Table:
ClerkID PK int autonumber
EmployeeID FK (to Employee table) int
JobDesc varchar....
This would create a 1:m relation between Employee and Clerk. This isn't the way the inheritance works.
If there's a 1:m relation, two clerks could point to the same EmployeeID (John Smith, f.i.).
You would say: then lets add a UC (Unique Constraint to Clerk.EmployeeID). Well, that isn't good as well.
The idea is that Clerk inherits from Employee, including its PK, so at code you could do something like:
ClerkEntity myClerk = new ClerkEntity(someClerkIdSoEmployeeId);
EmployeeEntity myClerk = new ClerkEntity(someClerkIdSoEmployeeId);
I you have two fields that unique identify Clerk (EmployeeID and ClerkID) that doesn't make sense to the inheritance approach.
Hope this was helpful