Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

request for idea about designing database like wat friendster does

Posted on 2006-07-16
7
193 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

828 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