2 versions of an entity worth distinct table?

Started by gvimover 15 years ago5 messagesgeneral
Jump to latest
#1gvim
gvimrc@gmail.com

If a table representing contact details can have 2 but no more than 2 email addresses is it really worth factoring-out email addresses to a separate table. Technically it's a 1-to-many relationship so should be done this way but what is the general practice out there in such "max. 2" situations? Keeping them as:

Primary Email
Secondary Email

.... also preserves priority though not strictly normalised, I know.

gvim

#2Radosław Smogura
mail@smogura.eu
In reply to: gvim (#1)
Re: 2 versions of an entity worth distinct table?

Hi,

In this particular case it isn't worth to add separate table just for
additional e-mail.

gvim <gvimrc@gmail.com> Monday 27 December 2010 02:47:29

Show quoted text

If a table representing contact details can have 2 but no more than 2 email
addresses is it really worth factoring-out email addresses to a separate
table. Technically it's a 1-to-many relationship so should be done this
way but what is the general practice out there in such "max. 2"
situations? Keeping them as:

Primary Email
Secondary Email

.... also preserves priority though not strictly normalised, I know.

gvim

#3Thomas Kellerer
spam_eater@gmx.net
In reply to: gvim (#1)
Re: 2 versions of an entity worth distinct table?

gvim wrote on 27.12.2010 02:47:

If a table representing contact details can have 2 but no more than 2
email addresses is it really worth factoring-out email addresses to a
separate table.

If you are absolutely sure you will never have more than two, then I agree, you don't need to create a 1:N relationship for that.
Especially because guaranteeing that there will never be more than two in the N part is quite complicated.

Regards
Thomas

#4Rob Sargent
robjsargent@gmail.com
In reply to: Thomas Kellerer (#3)
Re: 2 versions of an entity worth distinct table?

But then a) because you can't guarantee this design won't 'improve' and
b) you would like to look in one place for all addresses, normalize now.

Thomas Kellerer wrote:

Show quoted text

gvim wrote on 27.12.2010 02:47:

If a table representing contact details can have 2 but no more than 2
email addresses is it really worth factoring-out email addresses to a
separate table.

If you are absolutely sure you will never have more than two, then I
agree, you don't need to create a 1:N relationship for that.
Especially because guaranteeing that there will never be more than two
in the N part is quite complicated.

Regards
Thomas

#5Chris Browne
cbbrowne@acm.org
In reply to: gvim (#1)
Re: 2 versions of an entity worth distinct table?

gvimrc@gmail.com (gvim) writes:

If a table representing contact details can have 2 but no more than 2 email addresses is it really worth factoring-out email addresses to a separate table. Technically it's a 1-to-many relationship so should be done this way but what is the general practice out there in such "max. 2" situations? Keeping them as:

Primary Email
Secondary Email

.... also preserves priority though not strictly normalised, I know.

I'd be inclined to normalize this, as it's:

a) difficult to guarantee that it will only ever be 2.

b) mighty nice to be able to attach validation rules to ONE simple email
table, rather than having to put them on several columns possibly
spread across more tables.
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','gmail.com').
http://linuxfinances.info/info/internet.html
If nothing ever sticks to Teflon, how do they make Teflon stick to the
pan?