For a school project, we need to create our own database. I decided to create a database for inventory management of electronic components. As a requirement, we needed to create an ER diagram, and then get a database diagram from this diagram. Unfortunately for me, the professor believes that the diagram I created can be simplified, and the "Part" entity is not needed.
This is the diagram I came up with, and here is the derivative diagram.
If I delete the Part object, in order for the Circuit object to "use" any amount of any part and have each part associated with a possible circuit, I would have to have a separate M-to-N relationship from each type of component to Circuit. Each of these relationships will create a new table. This will definitely go to the strict maximum number of tables that we are allowed for the project.
If the professor specifically mentioned “Part”, this is not necessary, then there must be some way to remove it, which will lead to a simpler diagram and ER scheme, but I don’t see what it is.
Perhaps you guys can understand what it is and give me a hint?
EDIT: Dan had a great suggestion. I could exclude the part by giving each type of part (Capacitor, Resistor, etc.) its own keys. Then, inside the use part, foreign keys to these components are included. I would have to assume that each table entry will be associated with only one part, and the rest - zero. Below is a diagram. This circuit should work well. But now I have to find out exactly what changes in the ER diagram will correspond to this diagram.
EDIT2: I came to the conclusion that the relationships I am looking for are n-ary. According to several sources, to convert from n-ary to a schema, you include the primary key of each relationship of the type of participating entities as a foreign key. Then add simple attributes. This is what I came up with.