Hi,
I was seeking for an opinion concerning database design. I’ve got a Company Class having several properties.
A value will be assigned to the property via GUI. These properties are quite static i.e. likely won’t change.
Usually one goes for an approach whereby Property1, Property2, Property3 map into table columns. However what about if we're talking about 20-40 properties? I can envisage 2 options:
IMO possibility 1 is easier to work with while possibility 2 is more flexible. However, CompanyPropertyValue.Value field should accomodate multiple data types??!!.
Any suggestions will be appreciated.
Possibility 1.
CompanyPropertyValue Table
CompanyID int
Property1 int
Property2 varchar()
Property3 decimal
…
Property20 varchar()
Possibility 2
CompanyProperty Table
PropertyId int
PropertyCode
PropertyName
Eg. 1
D77
Turnover
CompanyPropertyValue Table
PropertyId int
CompanyID int
Value
Eg.5
1
100.00