Sub-Entities

From: <wbarthol_at_gmail.com>
Date: 1 Jul 2005 19:57:42 -0700
Message-ID: <1120273062.271114.45080_at_g49g2000cwa.googlegroups.com>



When creating sub-entities should you put a column in the root table saying what kind of sub-entity it is, or is the presence of a row in the more specific table? For example:

CREATE TABLE dbo.Clients
(

ClientIdentifier varchar(20) NOT NULL PRIMARY KEY )

CREATE TABLE dbo.Individuals
(

ClientIdentifier varchar(20) NOT NULL PRIMARY KEY REFERENCES dbo.Clients ( ClientIdentifier ),
NameTitleCode varchar(12) NOT NULL,
GivenName varchar(40) NOT NULL,
FamilyName varchar(40) NOT NULL
)

CREATE TABLE dbo.Organizations
(

ClientIdentifier varchar(20) NOT NULL PRIMARY KEY REFERENCES dbo.Clients ( ClientIdentifier ),
OrganizationName varchar(200) NOT NULL
)

What is the best way to force a client to only be an individual OR an organization? Trigger? Received on Sat Jul 02 2005 - 04:57:42 CEST

Original text of this message