I have a requirement to design 2 or more tables. 1. SubParts table 2. MainParts table.
A single MainPart can have multiple subparts. I am thinking of doing something like
SubPart table: Id and Name
MainPart table: Id and Name
SubPart_MainPart relationship table: MainPart_ID SubPart_Ids(array or comma seperated)
Is there a way to put multiple subpart_id in single column in the relationship table? or should I use MainPart_D and SUbPart_ID as combined primary key in the relationship id?
the second approach will increase lot of records in the relationship table. where as the first approach will increase looping the code when I try to iterate the comma separated column(SubPart_Ids).
Do you have any other approach for this?
thanks for your help