?
Solved

request for idea about designing database like wat friendster does

Posted on 2006-07-16
7
Medium Priority
?
196 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
[X]
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
  • 2
7 Comments
 
LVL 17

Accepted Solution

by:
ZeonFlash earned 80 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

752 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