May 9, 2013 at 10:04 pm
i have a table where i need to populate child table in parents table i have a column which is a surrogate key and this same column is PK in child table my question is can i use Surrogate key as PK in child table??
May 10, 2013 at 2:34 am
aslamshaik6 (5/9/2013)
i have a table where i need to populate child table in parents table i have a column which is a surrogate key and this same column is PK in child table my question is can i use Surrogate key as PK in child table??
Do you mean if it's ok to use the same Surrogate Key as PK in "parent" and it's "child" tables? If so, that it's legitimate and fine. If you have 1-to-1 relationship than this surrogate key will be PK in a child table by itself, if you have 1-to-many,than your child table key will be composite and contain surrogate key from parent table.
By the way, the main reason for surrogate key to exist is to provide non-application data identifier eg. PK.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply