This is a discussion on column name suggestion within the MySQL forums, part of the Database Server Software category; --> I have 'members' table in my app A member 'knows' 0-to-many other members and a member 'is_knowned_by' 0-to-many other ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have 'members' table in my app A member 'knows' 0-to-many other members and a member 'is_knowned_by' 0-to-many other members Obviously, I need to create a table 'relationships' to maintain the relationship data between 2 members of a network : creation_date, relationship_type.... no problem at this point.... to create this relationship table I need to give a label to the 2 foreign keys, but as a non-english dev, I actually don't know hos Is hould name this keys in english..... shoudl I use 'knowned_by_id' and 'knows_id' or have you any better suggestion ? thanks a lot joss |
| |||
| Josselin wrote: > I have 'members' table in my app > A member 'knows' 0-to-many other members and a member 'is_knowned_by' > 0-to-many other members > > Obviously, I need to create a table 'relationships' to maintain the > relationship data between 2 members of a network : > creation_date, relationship_type.... no problem at this point.... > > to create this relationship table I need to give a label to the 2 > foreign keys, but as a non-english dev, I actually don't know hos Is > hould name this keys in english..... shoudl I use 'knowned_by_id' > and 'knows_id' or have you any better suggestion ? > > thanks a lot > > joss will this do... members_friends member_id*,friend* is_known_by = SELECT member_id FROM members_friends WHERE friend = x knows = SELECT friend FROM members_friends WHERE member = x SELECT |
| |||
| Josselin wrote: > I have 'members' table in my app > A member 'knows' 0-to-many other members and a member 'is_knowned_by' > 0-to-many other members > > Obviously, I need to create a table 'relationships' to maintain the > relationship data between 2 members of a network : > creation_date, relationship_type.... no problem at this point.... > > to create this relationship table I need to give a label to the 2 > foreign keys, but as a non-english dev, I actually don't know hos Is > hould name this keys in english..... shoudl I use 'knowned_by_id' > and 'knows_id' or have you any better suggestion ? > > thanks a lot > > joss will this do... members_friends(member_id*,friend*) *=primary key is_known_by = SELECT member_id FROM members_friends WHERE friend = x knows = SELECT friend FROM members_friends WHERE member = x |
| |||
| On 2006-12-23 18:40:35 +0100, "strawberry" <zac.carey@gmail.com> said: > > Josselin wrote: >> I have 'members' table in my app >> A member 'knows' 0-to-many other members and a member 'is_knowned_by' >> 0-to-many other members >> >> Obviously, I need to create a table 'relationships' to maintain the >> relationship data between 2 members of a network : >> creation_date, relationship_type.... no problem at this point.... >> >> to create this relationship table I need to give a label to the 2 >> foreign keys, but as a non-english dev, I actually don't know hos Is >> hould name this keys in english..... shoudl I use 'knowned_by_id' >> and 'knows_id' or have you any better suggestion ? >> >> thanks a lot >> >> joss > > will this do... > > members_friends(member_id*,friend*) > *=primary key > > is_known_by = > > SELECT member_id FROM members_friends WHERE friend = x > > knows = > SELECT friend FROM members_friends WHERE member = x thanks a lot for your help my concern is about using 'friend' as the 'relationship' will have a type_code ( 'friend', 'family' ', business',..) maybe I should go to 'related_to_id' and 'related_from_id' .... |
| ||||
| Josselin wrote: > On 2006-12-23 18:40:35 +0100, "strawberry" <zac.carey@gmail.com> said: > > > > > Josselin wrote: > >> I have 'members' table in my app > >> A member 'knows' 0-to-many other members and a member 'is_knowned_by' > >> 0-to-many other members > >> > >> Obviously, I need to create a table 'relationships' to maintain the > >> relationship data between 2 members of a network : > >> creation_date, relationship_type.... no problem at this point.... > >> > >> to create this relationship table I need to give a label to the 2 > >> foreign keys, but as a non-english dev, I actually don't know hos Is > >> hould name this keys in english..... shoudl I use 'knowned_by_id' > >> and 'knows_id' or have you any better suggestion ? > >> > >> thanks a lot > >> > >> joss > > > > will this do... > > > > members_friends(member_id*,friend*) > > *=primary key > > > > is_known_by = > > > > SELECT member_id FROM members_friends WHERE friend = x > > > > knows = > > SELECT friend FROM members_friends WHERE member = x > > thanks a lot for your help > my concern is about using 'friend' as the 'relationship' will have a > type_code ( 'friend', 'family' ', business',..) > maybe I should go to 'related_to_id' and 'related_from_id' .... Sorry, I don't know what a type_code is, so I don't really know what the problem you envisage is. Call it friend_id if that's clearer for you. |