Database Answers Header Fishing Boat in Fog, Alaska
Ineritance Design Notes for Physical Databases
Home Ask a Question Careers Data Models FAQs SQL Scripts Search Site Map  

Discussion Nr.1
The first discussion relates to the City Tourist Guide Data Model :-
1) A Super-Type called 'Things of Interest'.
2) Two Sub-Types of Hotels and Restaurants.

Each of these Sub-Types inherits all the attributes of the parent Super-Type of 'Things of Interest'.
In addition, they have attributes of their own.

The design of the corresponding Physical Database for Inheritance offers three choices :-
1. Create separate Tables for the Sub-Type and each Super-Type.
2. Combine all attributes of the Sub-Types upwards into the Super-Type, which results, of course, in one physical Table.
This is shown in the Denormalized Design.
3. Combine all attributes of the Super-Type downwards into Tables for each the Super-Type which results, of course, in two physical Tables in this example of a City Guide.
This is left as an exercise for the student.

Discussion Nr.2
The second discussion relates to the Customers Data Model

1. A CUSTOMER can be either a COMMERCIAL CUSTOMER or a PERSONAL CUSTOMER, which both inherit characteristics from CUSTOMER.
2. A PERSONAL CUSTOMER is also a PERSON, and inherits characteristics from PERSON.
3. A COMMERCIAL CUSTOMER has a CONTACT, who is also a PERSON, and therefore inherits characteristics from both CUSTOMER and PERSON.

NOTE that the Physical Data Model can have be generated in different ways to reflect the ways in which these logical relationships can be implemented in a Database.

There are four alternatives :-
1. One Consolidated Table.
2. One SubType Product Table
3. One SuperType Table, Many SubTypes each in its own Table, each containing all the shared Attributes. 
4. One SuperType Table with an 'extensible' table defined to identify the Attributes 
   specific to each Product Type.
5.  A "products" table, an "attributes" table, and a "specs" table. 
  The products table is like in 3.  
  The attributes table simply lists all available attributes and
  the Product_Atttributes table maps an attribute to a product, and
  provides an attribute value.

Barry Williams
Principal Consultant
Database Answers


[ Home Page | Ask Us a Question | Day in the Life | Email Us | FAQs | Search & Site Map ]

© IceBreaker WebDesigns 2001