Professional Web Applications Themes

column name suggestion - MySQL

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

  1. #1

    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

    Josselin Guest

  2. #2

    Default Re: column name suggestion


    Josselin wrote: 

    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

    strawberry Guest

  3. #3

    Default Re: column name suggestion


    Josselin wrote: 

    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

    strawberry Guest

  4. #4

    Default Re: column name suggestion

    On 2006-12-23 18:40:35 +0100, "strawberry" <com> said:
     
    >
    > 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[/ref]

    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 Guest

  5. #5

    Default Re: column name suggestion


    Josselin wrote: 
    > >
    > > 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[/ref]
    >
    > 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' ....[/ref]

    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.

    strawberry Guest

Similar Threads

  1. Suggestion
    By Mikael Lindkvist in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: January 29th, 11:11 PM
  2. Bound Column or Template Column (w dAdapater?) in DataGrid
    By Ravichandran Mahalingam in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: January 9th, 03:30 PM
  3. Replies: 0
    Last Post: July 7th, 08:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139