M358 - Entity - Relationship Modelling - Entity subtypes and constraints
fellstrider.com - the logo!
Home| OU Study Rooms | M358 Index | Block 1 - Information Systems | Block 2 - Relational Theory | Block 3 - SQL
Block 4 - Database development
 
Entity - Relationship Modelling - Entity subtypes and constraints

Entity subtypes

Entity types can have attributes that can possess different meanings in a given context. In this situation, the modelling rule that is applied is that each attribute can have only one meaning. This is of particular note in regard to separating an entity type into similar entities where there are common features. In other words, an entity type can be a supertype. Entities with the same properties plus additional properties will be created as subtypes of this supertype. The subtype will inherit the same properties as the supertype. The additional properties of the subtype will be extra to those of the supertype. These entity subtypes can themselves be supertypes with further subtypes having inherited properties and further extra properties.

Entity subtypes image
Entity types
   Student (StudentId, Name, Registered, Region)              //indentation to show subtyping
       GraduateStudent (DegreeObtained)
       CounselledStudent ()
             UnderGradStudent (DegreeStudied)
             DiplomaStudent ()

In the example above, it should be noted that each subtype:

is defined from the supertype. They are not occurrences of Student or CounselledStudent, nor can they ever be. Any occurrence of Student must be defined as:

Constraints

Constraints are represented in E-R models as:

Constraints should always be represented in the modelling construct unless it is not possible for it to be represented by any process other than a description.

Representation of an implicit constraint

The above diagram demonstrates that for an employee to be provided with a car, he/she must be a licensed employee. There is no direct connection between Employee and Car. Therefore, in addition to the constraint that the employee has to be a licensed employee to get a car, there is the added constraint that an occurrence of Employee cannot be provided with a car.

Representing a constraint by subtyping

There are various methods of showing a constraint in a model. With appropriate information it is possible to illustrate such a constraint through the use of subtypes as shown in the above image.

Home| OU Study Rooms | M358 Index | Block 1 - Information Systems | Block 2 - Relational Theory | Block 3 - SQL
Block 4 - Database development
Move on to Developing a conceptual data model.

Valid CSS! Valid XHTML 1.0!

Comments, suggestions, ideas to
Stuart Banner