Read that maybe 20 times before I understood. LOL Let me see if I have this right... If this were a "normal" table of component parts...
CREATE TABLE Component(ComponentID INT IDENTITY PRIMARY KEY...);
CREATE TABLE ComponentPart(ComponentID INT NOT NULL, PartID INT NOT NULL, PartQty TINYINT);
Any Component that is a bottom-level component does not appear in the domain of Component(ComponentID). Any Component that is a Top-level component (finished product) does not appear in the domain of ComponentPart(PartID), so use NOT EXISTS() to check for existence in those.
But what if the ComponentParts table is never materialized? (or is it, and I'm just not recognizing it?) Do I have to materialize the ComponentParts table by exploding the BOMs?