Good Day to everyone in SO.
I have problem in designing database for my project, which is eyelet factory production module. Just for record, I use MySQL, C# .NET Framework, and NHibernate for my project.
Background Story
For my project, there will be Item table. Item defines, well, all item included in production of eyelet. It can be Raw Material (Coil, Paint, Plate, etc), Intermediate Item (Punch Item, for now) and Final Product (Assembly Item, Polished Item, Colored Item and so on) which can be sold.
All item has Name, Stock, Threshold column, but SOME item can have Outer Diameter or Color column for example, and some item dont have that. The Optional Column here is dependent to Item Type ( e.g Coil only has Outer Diameter, Inner Diameter, and Height. While Paint only has Color, and Final Product has all of them) . Item also has multiple Unit (Kg, Pcs, Pack, etc) which can be converted to other unit. Again, some item may only has Kg unit associated while other item can has Kg and Pcs unit associated (and conversion rate between them).
This is what I had in my mind.
Item_Unit associative table
... Not yet finished, came here for advice.
The things I want to ask are :
Any advice, correction or even a whole make over are appreciated. Thank You Very Much
With one table for every item you will be having a lot of null columns. This is not termed as bad design in certain cases where the Items
doesn't vary much.
I would suggest if your Items are having too much different attributes than either use Parent-Child relation or the best way would be to use Entity–attribute–value model
This model will have fewer columns but more rows. Check if this model works for your problem.