Prev Next Chapter 9.
Inheritance Let's create two classes.
The capitals class contains state capitals which are also cities. Naturally, the capitals class should inherit from cities. The type of the attribute population is float , a native Postgres type for double precision floating point numbers. State capitals have an extra attribute, state, that shows their state. In Postgres , a class can inherit from zero or more other classes, and a query can reference either all instances of a class or all instances of a class plus all of its descendants.