You are here: Re: One-to-many with a twist « MsSQL Server « IT news, forums, messages
Re: One-to-many with a twist

Posted by Gert-Jan Strik on 06/01/05 13:20

Maybe the addresses you are using are never shared, but (unless this is
a business rule), this is purely coincidental. An address is an entity.
And with a foreign key relation you can specify that a publisher or an
agency has an address. It is not even uncommon to have several such
relations between two entities. For example, a publisher could have a
billing address and a shipping address. That would mean two
relationships to (potentially) the same address.

Looking at the address as being "properties" of a publisher is not the
way a relational database works.

If it is a business rule that addresses "must not be shared" then that
is a different matter which is probably best solved by writing a
trigger.

Gert-Jan


martind-crap1@mailblocks.com wrote:
>
> These are all very good thoughts, thanks. What happens if I have
> multiple n-to-1 relationships to the same child (e.g.
> Publisher-Address, Agency-Address -- but Addresses are never shared
> among entities) and I want to make them bidirectional?
>
> Items to consider:
> - All primary keys are enterprise keys (unique across all associated
> databases and tables).
> - Only one application has write-access to my data model
> - I want a data model that is resilient to change ... if I introduce
> another entity with an Address, I don't want to have to add another
> foreign key column
>
> What are some potential downsides to giving up referential integrity?
>
> Thanks!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация