K
Kathy R.
It's the end of the day and I'm second-guessing myself and need some
clarification regarding Primary and Secondary Keys and which tables they
should be in.
In a one-to-many relationship, the primary key is on the "one" side and
the foreign key is on the "many" side, right? I.e. an Individual can
have many phone numbers.
tblIndividual
IndID (PK)
FirstName
LastName
tblPhone
PhoneID (PK)
PhIndID (FK)
phonenumber
phonetype
What about in a one-to-one relationship? Does it really matter which
the foreign key goes in? Is there an acceptable/preferred practice?
I have a membership table where one of the fields is the manner in which
the individual joined. Since there's a limited number of ways to join,
but they can and do change over the years, I created a lookup table for
that bit of information. Currently (early stages of development) I have
the foreign key in the membership table. Since the membership table is
what I would consider the "main" table, should the primary key go into
the "child" table?
tblMembership
MembID (PK)
JoinDate
JoinOfficiant
MJoinMannerID (FK)
lkpJoinManner
JoinMannerID (PK)
JoinMannerCode
JoinManner
Thanks for your help!
Kathy R. (whose brain is currently mush - time for a break!)
clarification regarding Primary and Secondary Keys and which tables they
should be in.
In a one-to-many relationship, the primary key is on the "one" side and
the foreign key is on the "many" side, right? I.e. an Individual can
have many phone numbers.
tblIndividual
IndID (PK)
FirstName
LastName
tblPhone
PhoneID (PK)
PhIndID (FK)
phonenumber
phonetype
What about in a one-to-one relationship? Does it really matter which
the foreign key goes in? Is there an acceptable/preferred practice?
I have a membership table where one of the fields is the manner in which
the individual joined. Since there's a limited number of ways to join,
but they can and do change over the years, I created a lookup table for
that bit of information. Currently (early stages of development) I have
the foreign key in the membership table. Since the membership table is
what I would consider the "main" table, should the primary key go into
the "child" table?
tblMembership
MembID (PK)
JoinDate
JoinOfficiant
MJoinMannerID (FK)
lkpJoinManner
JoinMannerID (PK)
JoinMannerCode
JoinManner
Thanks for your help!
Kathy R. (whose brain is currently mush - time for a break!)