Reply to Re: please, how to realize generalization in sql server database

Your name:

Reply:


Posted by David Portas on 12/12/06 17:28

fireball wrote:
> please help, I need professional approach how to realize generalization
> (parent_table <- child_table) idea in sql server databse?
>
> in my Oracle db I can have PK of child_table as FK from parent_table: let's
> have shop with shoes, selling shoes, and foosd as well. Example of keys in
> my tables:
>
> Product (=parent_table)
> -------------
> 1
> 2
> 3
> 4
> 5
>
> Food (=child_table)
> -------------
> 2
> 3
> 4
>
> Shoes (=child_table)
> -------------
> 1
> 5
>
> Is that good idea, or not, and may I have the same in SQLServer (2005) ?
> (and, what about administrative aspects (like
> performance/concurency/updating ..) of generalization in RDMS?)
>
>
>
>
> regards

The syntax is the same in SQL Server and Oracle (and other SQL DBMSs as
well):

CREATE TABLE Product (sku INT NOT NULL PRIMARY KEY);

CREATE TABLE Food (sku INT NOT NULL PRIMARY KEY REFERENCES Product
(sku));

CREATE TABLE Shoes (sku INT NOT NULL PRIMARY KEY REFERENCES Product
(sku));

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

[Back to original 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

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