Solved

request for idea about designing database like wat friendster does

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

803 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