How to create member_follower table structure ?

  • i have one member table like following

    member_table

    memberid name address phone email

    NOW I want to give such facility that one member can follow as many other members

    how can i do so ?

    should i create new table ?

    should i use any flag?

    how?

  • With the information that you have provided I would suggest creating another table (MemberFollow not crazy about the name, but oh well) and have two FKs back to the member table one for follower and the other for follows.

    MemberFollowID

    FollowerMemberID

    FollowsMemberID

    Then you can insert multiple records for each "follow" a member has.



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • are you saying TWO FK ? IS IT OK ?

  • Yes you would need 2 FKS back to the member table. It is fine to have multiple FKs back to the same parent table.



    Microsoft Certified Master - SQL Server 2008
    Follow me on twitter: @keith_tate

    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Thanks 🙂

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply