Database Reference
In-Depth Information
To represent two subtypes (categories) in IDEF1X, you use the same category symbol shown in
Figure 6-29. The difference is that there will be two lines coming out of the category symbol
one to each
category, as shown in Figure 6-32. Because there are students who do not live in dorms and who are not
seniors, these categories are also incomplete; so there is only one horizontal line below the category symbol.
Student
entity
Student
StudentNum
LastName
FirstName
216
One line
indicates incomplete
categories
StudentDorm
category (entity
subtype)
SeniorStudent
category (entity
subtype)
StudentDorm
StudentNum (FK)
DormNum (FK)
SeniorStudent
StudentNum (FK)
ThesisTitle
ThesisArea
FIGURE 6-32
Two entity subtypes—incomplete categories
By contrast, Figure 6-33 represents a slightly different situation. There are two categories: students who
live in dorms (StudentDorm) and students who do not (StudentNonDorm) live in dorms. For students who
live in dorms, the attribute of interest is DormNum. For students who do not live in dorms, the attributes
of interest are the ones that give the students
local addresses (LocalStreet, LocalCity, LocalState, and
LocalZip). The difference between this example and the one shown in Figure 6-32 is that every student
must be in one of these two categories. These are called complete categories and are represented by two
horizontal lines below the category symbol.
'
Student
entity
Student
StudentNum
LastName
FirstName
Two lines
indicate complete
categories (every student
is in one of the
categories)
StudentDorm
category (entity
subtype)
StudentDorm
StudentNum (FK)
DormNum (FK)
StudentNonDorm
StudentNum (FK)
LocalStreet
LocalCity
LocalState
LocalZip
StudentNonDorm
category
(entity subtype)
FIGURE 6-33
Two entity subtypes—complete categories
You should group columns that can be null by function. If a given subset of the entity in question can
have nulls in a certain collection of columns, you should note this fact. When available, you should strongly
consider splitting columns that can have nulls into a separate table (an entity subtype). If you create an
entity subtype, you should give the entity subtype a name that suggests the related entity type, such as
SeniorStudent for students who are seniors. In addition, you should carefully document the meaning of the
entity subtype, especially the conditions that will cause an occurrence of the entity type also to be an occur-
rence of the entity subtype. If you do not create such an entity subtype, you must at least document pre-
cisely when the columns might take on null as a value.
Search WWH ::




Custom Search