Table per Class Inheritance
Explore the Table per Class Inheritance approach to organizing SQL tables for subclass hierarchies in front-end web apps. Understand how this method preserves class structure, improves memory efficiency, and the trade-offs with schema redundancy and subtype representation.
We'll cover the following...
The Table per Class Inheritance approach
In a more realistic model, the subclasses of Person, shown in the previous lesson, has many more attributes, so the Single Table Inheritance approach is no longer feasible here. In the Table per Class Inheritance approach, we get the SQL table model shown in the figure below:
A Table per Class Inheritance model represents each concrete class of the class hierarchy as a table. Each segment subclass is represented by a table that contains columns for inherited properties, repeating the columns of the table that represent the superclass.
We can derive a Table per Class Inheritance table model ...