# Database schema

**URL:** <https://www.ruby-forum.com/t/database-schema/72486>\
**Category:** Ruby\
**Created:** [October 17, 2006, 4:25pm UTC](https://www.ruby-forum.com/t/database-schema/72486 "2006-10-17T16:25:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NagasamudramS\_Prasa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/278dde/32.png) [@NagasamudramS\_Prasa](https://www.ruby-forum.com/u/NagasamudramS_Prasa)\
**Post date:** [October 17, 2006, 4:25pm UTC](https://www.ruby-forum.com/t/database-schema/72486/1 "2006-10-17T16:25:41Z")

</div>

Hi All

This is my first mail to this mailing list.

I started using the rails framework for ruby.

I was able to understand and create the sample cookbook application.

Now I want to try something new.

I basically want to write a application which would be similar to orkut.

Basically I want to have a database table which will have the  
information about the registered users.

And each user should have the reference to his friends.

For example

ID

NAME

Friends

1

Name1

3,4

2

Name2

4

3

Name3

4

4

Name4

1,2

I am not able to deduce on a database schema to achieve this. Should I  
have another table for friends ?

PS: do not reply to this mail, if you think this mail is irrelevant to  
this mailing list.

Thanks

Prasanna

---

<div class="post-metadata">

**Author:** ![NagasamudramS\_Prasa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/278dde/32.png) [@NagasamudramS\_Prasa](https://www.ruby-forum.com/u/NagasamudramS_Prasa)\
**Post date:** [October 17, 2006, 5:59pm UTC](https://www.ruby-forum.com/t/database-schema/72486/2 "2006-10-17T17:59:23Z")

</div>

On 10/17/06, Nagasamudram, Prasanna Kumar

You probably want to ask this on the Rails list; this is for Ruby  
questions. Better yet, you probably want to look up some database  
design techniques to answer how this should be done (hint: you want an  
association table).

-austin
