View Full Version : Associating Materials with table

03-01-2007, 07:38 PM
Hey, I was wondering if someone could help me with a design concept I am coming up for a database. In the database I am going to have a list of all parts of a machine. Some of them are assembly parts, while others are the parts of the assembly, however there can be an assembly within and assembly. Rather then creating a table for every single assembly which really would be horrendous on maintainability I am trying to make it so that the parts reference their sub-counterparts.

I thought the best way to do this would to use some php scripting to just determine which part goes with which assembly item, however as I said before there are assemblies within assemblies... I was just wondering what would be the most advantageous design for something of this nature.

03-02-2007, 03:33 PM
I did some research yesterday, however I am still puzzled on how I would go about setting it up so it could be as efficient as possible. How would I go about the assigning the index field so that one part can have multiple parents even if the parents do not lay on the same level.


. Printer
. carriage overflowtank fan
motor>wiring>fan wiring>nutsnbolts>fan>electron2 wiring>motor>electron1
>nutsnbolts>wiring nutsnbolts>wiring

Now on this there is a fan on multiple levels, and there is also wiring and nuts n bolts on differnet levels. So I want to be able to access the carriage on teh second level that lists the motor, wiring and the fan, however at thesame time its going to have different electronics then the fan on the overflow tank :| how would I index it so that if i want to access 1 parent and list its children I dont get parts from a child of a different parent, or children of the child.

And also would i create just one table for all of the parts? or would i create 1 for the parent "assemblies" and 1 table for the children "non assembly"? I guess im asking how I would access a parent from within a parent, because in either instances there are situations where I would need to access an additional parent within a parent...