Superclass and Subclass in DBMS

Superclass in DBMS:

Class: A set of objects that share a common structure and a common behaviour is called a class.

Object: In the ordinary sense, an object is something capable of being seen, touched or sensed. Putting it in layman’s language, an object is something that has a fixed shape or well-defined boundary. If you look at your computer desk, you would notice several objects of varying descriptions. They may be connected to or related to adjacent objects.

For example, a keyboard may be attached to a PC, and it is also easy to see that different parts of the PC are distinct objects.

Superclass: A class supertype is an object class whose instances store attributes that are common to one or more class subtypes of the object.

Inheritance: It means the methods and or attributes defined in an object class which can be inherited or reused by another object class. Inheritance is always transitive that can be transferred. A class can inherit features from superclasses many levels away. Inheritance means that the behaviour and data associated with child classes are always an extension of the properties associated with the parent class.

Subclass in DBMS:

A class subtype is an object whose instances inherit some common attributes from a class super type and then add other attributes that are unique to an instance of the subtype. A subclass must have all the properties of the parent class and other properties as well.