Re: Tree (forest) design

From: Robert Stearns <is_at_uga.edu>
Date: Fri, 27 Feb 2004 10:41:42 -0500
Message-ID: <c1nobp$1u$1_at_cronkite.cc.uga.edu>


I wish to have the location as a foreign key in my my inventory table; unfortunately any individual user can decide how much of the tree he wishes to implement; one level to six levels in both the administrative and location trees for any one user. Consider the difference between GM and Joe's Used Cars. Your solution would have compostie foreign key made up of a key from each level in each inventory record, if I understood it correctly. This appears to be massively redundant, and, in the case of a small customer, massively wasteful.

My solution is to have the location foreign key be the key of one row of the tree. Then I can select the inventory in any one location including or excluding the subordinate (contained) locations.

Mikito Harakiri wrote:

> "Robert Stearns" <rstearns1241_at_charter.net> wrote in message
> news:403E8CA0.1010505_at_charter.net...
>

>>Mikito Harakiri wrote:
>>
>>>Why <building, floor, room, rack, bin> is a tree?
>>
>>Buildings have multiple floors,

>
>
> I see this from your table signature:
> <building, floor, ...
>
> e.g.
> building floor
> -------- -----
> 1A15 1
> 1A15 2
>
>
>>each having multiple rooms etc.

>
>
> I see this as well:
> <building, floor, room,...
>
>
>>Each of
>>these entities may contain inventory items,

>
>
> I fail to see how this is related to the <..., rack, bin>.
> Where are inventory items in your schema?
>
>
>>and I want to be able to
>>reference the inventory on any level, including (or not) the sublevels.
>>For instance if the inventory referred to a manufacturing facilities,
>>screws might be in bins, engine blocks on racks, body panels in rooms,
>>etc. If you are dealing with car dealerships, the divisions might be the
>>dealership, (branch (lots, buildings (rooms))).

>
>
> So your dilemma is rigid schema with many tables vs. single but flexible
> hierarchy table, right?
>
>
>
>
Received on Fri Feb 27 2004 - 16:41:42 CET

Original text of this message