I have a question regarding the correct implementation of a Schema that I'm currently wrecking my head with:
We have machines, which consist of components, which consist of parts.
However, the relationships are as follows:
Furthermore, both parts and components that are flagged as needs_welding=1 will have a price associated with them. These prices will change over time.
I'm not quite sure as to how to model the following aspects:
A good solution for N->N mappings is to create a specific mapping table. So, for example, to map a Component to the Part(s) it is made of, you can create a table called something like MapComponentToItsParts, which has two columns, the first which contains the ID of the component, the second which contains the ID of the part. They should each be Foreign Keys to their respective tables. You can create similar tables to MapComponentToSubComponent, or MapMachineToPart.