2018_04_Hier_03

Two ways of modelling a hierarchy in SQL tables - single self-referencing table and closure table

Two ways of modelling a hierarchy in SQL tables

Diagram showing a self-referencing SQL table for product category alongside the category table with a closure table. Hierarchies are an SQL smell and a Requirements smell, because they are difficult to understand, document, specify and communicate.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.