Re: design

From: "Adam Lang" <aalang(at)rutgersinsurance(dot)com>
To:
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: design
Date: 2001-01-28 17:15:48
Message-ID: 004c01c0894d$f54375e0$330a0a0a@6014cwpza006
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Plus, it allows you to add more functionality later. Say you later want to
keep track of phone numbers. Add another table with a phone number field
linked to the master table with the users instead of making your one table
consistently larger.

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Brett W. McCoy" <bmccoy(at)chapelperilous(dot)net>
To: "Jeff" <jeff4e(at)rochester(dot)rr(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, January 30, 2001 11:51 AM
Subject: Re: [GENERAL] design

> On Tue, 30 Jan 2001, Jeff 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?
>
> I would put the addresses in a separate table and use the foreign key.
> That way each user can have as many addresses as you want. A year from
> now you might change your requirement to 5 addresses. Or perhaps you want
> to keep historical information.
>
> In general, if you find yourself designing a table where duplicate
> information is showing up (in this case, if you had only used one table,
> user names would have been entered 4 times, once for each address), you
> need to apply normalization and break it into two (or more) tables.
>
> -- Brett
>
http://www.chapelperilous.net/~bmccoy/
> --------------------------------------------------------------------------
-
> Health is merely the slowest possible rate at which one can die.

In response to

  • Re: design at 2001-01-30 16:51:11 from Brett W. McCoy

Browse pgsql-general by date

  From Date Subject
Next Message Adam Lang 2001-01-28 17:17:15 Re: LinuxWorld NYC
Previous Message James Thompson 2001-01-28 15:36:10 Re: GUI Interfaces