Design: how to prioritise 1-to-many fields
Design: how to prioritise 1-to-many fields
am 09.12.2010 15:33:06 von gvim
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@m.gmane.org
Re: Design: how to prioritise 1-to-many fields
am 09.12.2010 15:35:57 von Johan De Meersman
--90e6ba53acf4eccb740496fb275c
Content-Type: text/plain; charset=ISO-8859-1
On Thu, Dec 9, 2010 at 3:33 PM, gvim 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--
RE: Design: how to prioritise 1-to-many fields
am 09.12.2010 16:51:24 von Jerry Schwartz
>From: gvim [mailto:gvimrc@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@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@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@m.gmane.org
Re: Design: how to prioritise 1-to-many fields
am 12.12.2010 02:23:50 von Jan Steinman
> From: gvim
>=20
> 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@m.gmane.o rg