June 2004
Intermediate to advanced
240 pages
4h 39m
English
CHAPTER 6 The Linear Version of the Nested Sets Model
IF YOU LOOK at the diagram that shows the left and right numbers on a number line, you will realize that this diagram can be used directly to represent a tree in a nested sets model. The left and right (lft, rgt) numbers each appear once, but the nodes of the tree appear exactly twice—once with the lft number and once with the rgt number. The table can be defined like this:

In fairness the “got_all_numbers” and “exactly_twice” constraints will be hard to implement in most SQL products today, but they are legal in full SQL-92. Our OrgChart tree is represented by this data.
The standard ...
Read now
Unlock full access