In: Computer Science
Could you expound in database modeling, how subclass and superclass are used? Maybe you can use these terms(cardinality constraint , total participation constraint, weak entity type, partial key, IS-A relationship, specialization and generalization, specific (or local) attribute, specific relationship, aggregation)
Specialized class are often called as subclass while generalized class are called superclass, probably inspired by object oriented programming. A sub-class is best understood by “IS-A analysis”. Following statements hopefully makes some sense to your mind “Technician IS-A Employee”, “Laptop IS-A Computer”.
An entity is specialized type/class of other entity. For
example, Technician is special Employee in a university system
Faculty is special class of Employee. We call this phenomenon as
generalization/specialization. In the example here Employee is
generalized entity class while Technician and Faculty are
specialized class of Employee.
Example – This example instance of “sub-class” relationships. Here we have four sets employee: Secretary, Technician, and Engineer. Employee is super-class of rest three set of individual sub-class is subset of Employee set.
Constraints – There are two types of constraints on “Sub-class” relationship.