Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Sub-Entities

Sub-Entities

From: <wbarthol_at_gmail.com>
Date: 1 Jul 2005 19:57:42 -0700
Message-ID: <1120273062.271114.45080@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 Fri Jul 01 2005 - 21:57:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US