Unix Technical Forum

column name suggestion

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 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 08:49 AM
Josselin
 
Posts: n/a
Default column name suggestion

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 08:49 AM
strawberry
 
Posts: n/a
Default Re: column name suggestion


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 08:49 AM
strawberry
 
Posts: n/a
Default Re: column name suggestion


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 08:49 AM
Josselin
 
Posts: n/a
Default Re: column name suggestion

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' ....

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 08:49 AM
strawberry
 
Posts: n/a
Default Re: column name suggestion


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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:58 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com