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.
Only if you have mostly 4 address users. And then it questionable.
> 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?
Yes! Though at first reading I thought you had your primary key and
foreign key reversed.
Primary key user_id (???) in the user table.
Foreign key references user(user_id) in the address table.
You might want to think of an ordering attribute (column) in the address
table so you can select a preferred address when only on is wanted.
Have a normalized day,
Rod
--