If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Fuzzy on an ER decision

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-08, 10:01
sydbarrett74 sydbarrett74 is offline
Registered User
 
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).
Reply With Quote
  #2 (permalink)  
Old 10-06-08, 10:43
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
If I were to add you to my friends list, would that automatically add me to your friends list?
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 10-06-08, 11:05
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 10-06-08, 11:36
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
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"
Reply With Quote
  #5 (permalink)  
Old 10-06-08, 13:58
Thrasymachus Thrasymachus is offline
SQL Server Street Fighter
 
Join Date: Nov 2004
Location: Down The Rabbit Hole
Posts: 7,979
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.
__________________
software development is where smart people go to waste their lives
Reply With Quote
  #6 (permalink)  
Old 10-06-08, 16:15
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
That's why on dbforums we have buddy lists - there's a clear distinction
__________________
George
Twitter | Blog
Reply With Quote
  #7 (permalink)  
Old 10-08-08, 15:32
sydbarrett74 sydbarrett74 is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 10-08-08, 15:40
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
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"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On