Re: Parts explosion with repeated subtrees

From: Tony V <tony_at_delluna.com>
Date: 17 Dec 2002 19:43:50 -0800
Message-ID: <ba685ae0.0212171943.46e4bc95_at_posting.google.com>


Sorry about the proprietary code. I work with SQL Server 2000 and as ou are probably aware Microsoft has many proprietary extensions or ways of writing SQL.

I see your point. I guess I will have a reason to by your new book. :)

Tony

71062.1056_at_compuserve.com (--CELKO--) wrote in message news:<c0d87ec0.0212171254.c85b718_at_posting.google.com>...
> Actually, your code is so proprietary I had a hard time reading it; is
> this what you meant to post, if you used ISO-11179 specs, had keys,
> constraints, etc. ?
>
> CREATE TABLE Menu
> (menu_id INTEGER NOT NULL PRIMARY KEY,
> item VARCHAR(25) NOT NULL,
> parent_id INTEGER NOT NULL
> REFERENCES Menu(menu_id),
> level_id INTEGER NOT NULL);
>
> INSERT INTO Menu VALUES (1,'Eggs Benedict', 0, 1);
> INSERT INTO Menu VALUES (2, 'English Muffin', 1, 2);
> INSERT INTO Menu VALUES (3, 'Canadian Bacon', 1, 2);
> INSERT INTO Menu VALUES (4, 'Egg', 1, 2);
> INSERT INTO Menu VALUES (5, 'Béarnaise sauce', 1, 2);
> INSERT INTO Menu VALUES (6, 'Dill', 5, 3);
> INSERT INTO Menu VALUES (7, 'Hollandaise sauce', 5, 3);
> INSERT INTO Menu VALUES (8, 'Egg', 7, 4);
> INSERT INTO Menu VALUES (9, 'Lemon Juice', 7, 4);
> INSERT INTO Menu VALUES (10, 'Butter', 7, 4);
>
> Sorry, but a few decades of writing and working with standards makes
> me a bit complusive. Now, another human being can read and use your
> code to test things in any Standard SQL!!
>
> Having done that work, this is an Adjacency model and it has the same
> problem my nested set model does. Namely, 'Béarnaise sauce' and
> 'Hollandaise sauce' explosions have to be repeated in EVERY recipe.
> In your model, they will get various level numbers, in mine, they get
> various (lft,rgt) pairs.
>
> What I want is a way for them to appear once in the schema and
> expanded in a VIEW as tehy are used.
Received on Wed Dec 18 2002 - 04:43:50 CET

Original text of this message