liveBook · Manning

Subtyping

As explained in 100 SQL Server Mistakes and How to Avoid Them

A subtype is a specialized entity type that inherits common attributes from a supertype and may add unique attributes.

Subtyping separates shared person data from role-specific data. A People entity can hold First Name, Last Name, and Email for salespeople, customer contacts, supplier contacts, and sales area managers. A specialized entity then stores attributes that apply only to one role. section 4.1.3

A practical rule is to move common attributes into the supertype and keep unique attributes in the subtype. For example, Sales Persons can join back to People while retaining Sales Target and Employee Number. This avoids repeating the same person details across several role entities. section 4.1.3

Person and employee roles

People is the supertype; Sales Persons is a subtype with sales-only fields. The AdventureWorks sample database uses the same pattern: Employees is a subtype of Person. section 4.1.3

How 100 SQL Server Mistakes and How to Avoid Them covers it

How deep it goes
Defines supertypes and subtypes through a People and Sales Persons modeling example without implementation details.
Examples
Uses People, Sales Persons, and AdventureWorks Person and Employees as subtype examples.
What you can do after
Evaluate/understand when common attributes belong in a supertype and unique attributes belong in a subtype.
How it connects
Connects subtyping with data generalization, normalization, entities, relations, and joins.

Also explained in

Compare how 4 books explain subtyping →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of 100 SQL Server Mistakes and How to Avoid Them. The section links point to the parts of the book it draws on.