You are here: Re: SQL relationships and identities « MsSQL Server « IT news, forums, messages
Re: SQL relationships and identities

Posted by David Portas on 12/07/05 19:19

Mike wrote:
> Can anyone tell me what is best practices to define relationships between
> tables and to define their primary key?
>

I think you mean Foreign Keys, not "relationships". Foreign Keys
maintain referential integrity by ensuring that data is complete and
consistent in your tables.

> For example...
> One table is Orders and other is OrderDetails.
> For ease of accessing datas from table OrderDetails I have fields copied
> from Orders like year_of_order, order_number, client_id.
>

What does "ease of accessing data" mean? I think you are making a
fundamental error. Do you understand what Normalization is? There is a
set of well-founded principles for designing a database schema and you
don't seem to be familiar with them. I recommend you take a course or
study a book on design because there is far more material for you to
cover than we can sensibly try to convey in a newsgroup.

--
David Portas
SQL Server MVP
--

 

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

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