View Full Version : Representing networked people

08-05-2005, 08:07 AM

I'm trying to design a system for my work where different admins can add people connected to them. At the bare bones, this is just like a social networking site like Friendster.

From a database perspective, how do you implement a representation of people being linked to a variable number of other people. I was originally thinking to use some kind of variable array attribute in the person table. The only option is SET but that only allows for 64 items. Are there any efficient and flexible ways to implement this "social networking" structure?

Best, Jay

08-05-2005, 10:43 PM
a classic many-to-many data realtionship: two tables
a table that stores the users
a table that links users together

the link table would look something like:
link_id (INT) PK
user1 (INT)
user2 (INT)

the user1 and user2 fields relate to the PK from the users table.