Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2008
    Posts
    3

    Question Fuzzy on an ER decision

    Hello all,
    I am developing a db-backed website and am trying to implement a friends list (i.e., users can have other users as friends). I'm trying to decide whether the entity relationship should be one-to-many recursive or many-to-many recursive. Can anyone give me some guidance? (It's been years since I took my last database course).

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    If I were to add you to my friends list, would that automatically add me to your friends list?
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by sydbarrett74
    I'm trying to decide whether the entity relationship should be one-to-many recursive or many-to-many recursive.
    if it were one-to-many recursive, that would imply that tom could have dick and harry as friends, but both dick and harry could only have tom as a friend

    somehow, i don't think that's gonna cut it
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    You haven't met Dick and Harry. Tom is the only person who can stand them.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    i think dude is imagining something like

    table1
    PersonID PK,
    Name

    table2
    MyPersonID FK,
    MyFriendsPersonID FK

    With both PersonIds in table 2 FKing back to PK personid.

    Personally I hate social networking sites. My true friends can ever be "deleted" and I think the word friend has been devalued by those who think you can.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    That's why on dbforums we have buddy lists - there's a clear distinction
    George
    Home | Blog

  7. #7
    Join Date
    Sep 2008
    Posts
    3

    Talking

    Quote Originally Posted by Thrasymachus
    Personally I hate social networking sites. My true friends can ever be "deleted" and I think the word friend has been devalued by those who think you can.
    To assuage everyone's fear, I'm not creating YASS (Yet Another Social Site). Hopefully that makes my intentions seem less nefarious.

  8. #8
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Are you creating an Anti-Social site? That sounds even more nefarious.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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