Design: how to prioritise 1-to-many fields

I have a typical contact database which caters for multiple email addresses with a distinct Email table keyed to a foreign key inside the Contact table, ie. a 1-to-many relationship. However, I want to prioritise these Email entries for a given Contact entry so all I can think of is to add a numeric Priority field alongside the Address field inside the Email table. Is this the best/standard solution or is there another way?

gvim

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2 [at] m.gmane.org
gvim [ Do, 09 Dezember 2010 15:33 ] [ ID #2051491 ]

Re: Design: how to prioritise 1-to-many fields

--90e6ba53acf4eccb740496fb275c
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Dec 9, 2010 at 3:33 PM, gvim <gvimrc [at] gmail.com> wrote:

> I have a typical contact database which caters for multiple email addresses
> with a distinct Email table keyed to a foreign key inside the Contact table,
> ie. a 1-to-many relationship. However, I want to prioritise these Email
> entries for a given Contact entry so all I can think of is to add a numeric
> Priority field alongside the Address field inside the Email table. Is this
> the best/standard solution or is there another way?
>

That would be it, I guess, yeah :)



--
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel

--90e6ba53acf4eccb740496fb275c--
Johan De Meersman [ Do, 09 Dezember 2010 15:35 ] [ ID #2051492 ]

RE: Design: how to prioritise 1-to-many fields

>From: gvim [mailto:gvimrc [at] gmail.com]
>Sent: Thursday, December 09, 2010 9:33 AM
>To: MySQL
>Subject: Design: how to prioritise 1-to-many fields
>
>I have a typical contact database which caters for multiple email addresses
>with a distinct Email table keyed to a foreign key inside the Contact table,
>ie. a 1-to-many relationship. However, I want to prioritise these Email
>entries
>for a given Contact entry so all I can think of is to add a numeric Priority
>field alongside the Address field inside the Email table. Is this the
>best/standard solution or is there another way?
>
[JS] Sounds about right to me, but don't use a sequence like 1, 2, 3. Use 10,
20, 30. You never know when you'll have to squeeze in a new priority level,
and you don't want to have to renumber them all.


Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry [at] gii.co.jp
Web site: www.the-infoshop.com



>gvim
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe: http://lists.mysql.com/mysql?unsub=jerry [at] gii.co.jp





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2 [at] m.gmane.org
Jerry Schwartz [ Do, 09 Dezember 2010 16:51 ] [ ID #2051494 ]

Re: Design: how to prioritise 1-to-many fields

> From: gvim <gvimrc [at] gmail.com>
>
> I have a typical contact database which caters for multiple email =
addresses with a distinct Email table keyed to a foreign key inside the =
Contact table, ie. a 1-to-many relationship. However, I want to =
prioritise these Email entries for a given Contact entry so all I can =
think of is to add a numeric Priority field alongside the Address field =
inside the Email table. Is this the best/standard solution or is there =
another way?

Ask yourself, "what has a relationship with what." Do these Email table =
entries have relationships with each other?

Perhaps a better way would be for Email table entries to be threaded =
together in a linked list: "Primary --> Secondary --> Tertiary --> ..." =
rather than put an arbitrary number in there.

----------------
I hope we shall crush in its birth the aristocracy of our moneyed =
corporations which dare already to challenge our government to a trial =
of strength. -- Thomas Jefferson
:::: Jan Steinman, EcoReality Co-op ::::


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2 [at] m.gmane.o rg
Jan Steinman [ So, 12 Dezember 2010 02:23 ] [ ID #2051540 ]
Datenbanken » gmane.comp.db.mysql.general » Design: how to prioritise 1-to-many fields

Vorheriges Thema: List archive?
Nächstes Thema: migrating a split replication