Re: design - Mailing list pgsql-general

From missive@frontiernet.net (Lee Harr)
Subject Re: design
Date
Msg-id 957iso$mp2$1@node17.cwnet.frontiernet.net
Whole thread Raw
In response to design  (Jeff <jeff4e@rochester.rr.com>)
List pgsql-general
On Tue, 30 Jan 2001 11:35:21 -0500, Jeff <jeff4e@rochester.rr.com> wrote:
>I have a design question.  Lets say we want to keep track of users and
>their respective snail mail addresses.  Each user can have up to 4
>different mailing address.  Is it better to have all this information in
>one table. Or is it better to have a user table and an address table,
>and have the user id as a foreign key in the address table?
>
>Thanks!
>
>Jeff
>


The second option sounds much better to me.
Imagine trying to find out how many addresses each user has:

With everything in one table... tough one.
With all addresses in their own table and keyed by user id... simple.

I am sure you can find other reasons too.

Lee Harr
missive@hotmail.com

pgsql-general by date:

Previous
From: Raymond Chui
Date:
Subject: Unrecognized language plpgsql when CREATE FUNCTION?!
Next
From: Jeff Greer
Date:
Subject: can't connect, strange error