Solved

request for idea about designing database like wat friendster does

Posted on 2006-07-16
7
194 Views
Last Modified: 2010-04-23
I would like to design an application which able to track 10 degrees of client...

juz like friendster.. can get to know who are your second degree frd.. third degree frd...

anyone can give me ideas about designing such database?
0
Comment
Question by:kengkit
  • 2
7 Comments
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 20 total points
ID: 17117431
You should be able to pull off something like that with a pair of tables.  One is your basic user table that contains all the user information (demographic, login, etc.), while the other table is simply a linking table between users.  For example (assuming that you'll be using MS-SQL since you didn't specify):

tblUsers
  userPKID
  userLogin
  userPassword
  userCity
  ...etc

tblFriends
  frUserPKID
  frFriendPKID

So to get a user's friends, you do:
SELECT userPKID, userLogin, ...
FROM tblUsers
   INNER JOIN tblFriends ON userPKID = frFriendPKID
WHERE userPKID = [The user you're getting the friends of]

From there on it gets interesting to write the queries, but it can be done with a little time.
0
 
LVL 24

Expert Comment

by:Jeff Certain
ID: 17123092
Funny... there's exactly this problem described in the latest issue of Dr. Dobbs.... http://drdobbs.com/dept/database/189401684

They describe a tool called Cogito, but do a pretty good job ob describing the process.

And, yes, it's very similar to what ZeonFlash describes.

One caveat... you either need to write queries that return for the friendID and the userID being the ID you're looking for... or have duplicate information in your database table.
0
 

Author Comment

by:kengkit
ID: 17127538
To: ZeonFlash

Thx for ur suggestion.. i will try it out when i free! Point will be award once i have a test later..

by the way.. i can foresee tat the table of tblFriends will be very huge if i got many many user
0
 
LVL 24

Expert Comment

by:Jeff Certain
ID: 17315486
Bob,

Full points to ZeonFlash.

Jeff
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question