Problem of Inheritance:
in the relational environment does not directly support inheritance, however, we can consider the following three choices.
1. Table per class hierarchy
2. Table for subclass.
3. Table for concrete class.
Table per class hierarchy:
In this process we can map the entire class hierarchy to a single table. This table includes columns ofr the properties of al classes in the hierarchy.
This is basic and easier to use, and efficient to compare other two approaches.
The columns for properties declared by subclasses must be declared to accept null
Values, these columns cannot be declared with NOT NULL constraint.
create table employeedetails(empno int(4),category char(16),ename char(16),annualSal int(4))
//this program will describes – Table per class hierarchy