liveBook · Manning

Supertype

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

A supertype is a generalized entity type whose common attributes and relationships can be inherited by more specialized subtypes.

A supertype is a general entity that holds attributes shared by several more specific entity types. Use it when separate entities repeat the same core details; centralizing them reduces duplication and gives common data one consistent home. section 4.1.3

Keep attributes unique to a role in a subtype, then join that subtype back to the supertype. This avoids forcing sales-specific fields onto every kind of person while retaining shared identity and contact details. section 4.1.3

People and salespersons

Salespeople, customer contacts, supplier contacts, and sales area managers can share First Name, Last Name, and Email in People. Sales Persons can then hold Sales Target and Employee Number as subtype-only attributes. AdventureWorks similarly models Employees as a subtype of Person. section 4.1.3

Apply the pattern with a simple check:

  • Identify entities with genuinely common attributes, such as names and email addresses. section 4.1.3
  • Move the shared attributes into one general entity. section 4.1.3
  • Create a subtype only for attributes that apply to that specialized role, and join it to the supertype. 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 example, including unique subtype attributes and a join back.
Examples
Uses People and Sales Persons, plus AdventureWorks Person and Employees, to illustrate the pattern.
What it assumes
Builds on data generalization and first normal form while presenting supertypes as a more advanced technique.
What you can do after
Evaluate/understand when shared person attributes belong in a supertype and role-specific attributes belong in subtypes.
How it connects
Connects data generalization with normalization, entities, relations, attributes, and joins.

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.