Good afternoon, I am studying databases now and a question has arisen where can I read about

Information model of storage of a tree structure in a relational database ???

thank

1 answer 1

When working with tree structures, you should keep in mind the four most common patterns:

  1. Neighborhood List (id key - parent parent_id)

  2. Listing paths (1/5/21/128 / - Parent ID numbers)

  3. Closure table

  4. Nested Set

These are the four main patterns that are commonly used to organize tree structures. You can read anywhere if you get the book "Joe Selko. SQL" / "Joe Celko's. SQL for smatties: advanced SQL programming" - they are well described there.