Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Representing a network using a database

Author  Topic 

jangozo
Starting Member

1 Post

Posted - 2009-10-04 : 10:40:28
Hello,

I'm trying to represent an instant messenger's network of contacts in a database. As most of you know each client will have many contacts who will also have many contacts.

The design I'm thinking of now is the following:

USERS
| username | password |
| a | none |
| b | none |
| c | none |

CONNECTIONS
| connection id | username 1 | username 2 |
| 1 | a | b |
| 2 | a | c |
| 3 | b | c |

Do you agree this is the best way to represent a network using a database? If not what would you suggest?

Thanks,
Vladimir

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-10-04 : 15:55:24
Hi

Try this....


User_Table
User_ID User_NAME
10 raj
11 daksha
12 yesvanth


Connection_Table
Con_ID Con_Desc
110 xxx
120 yyy
130 zzz


User_Connections_Table
User_id Con_ID
10 110
10 120
10 130
11 110
12 120


I have done with second normal form...
Eliminate Redundant Data - If an attribute depends on only part of a multi-valued key, remove it to a separate table.



-------------------------
R...
Go to Top of Page
   

- Advertisement -