I was reading the concept of normalization of database structure. I got confused with the following situation in my project.
- I have two tables "
TableA
" andTableB
- Both tables are independent of each other and have no realtionship at all
- They represent completely different data
- Both the tables will have different parameters. However
Parameter
itself as an object has same properties.
So my concern is should I have single Parameter
table which is serving TableA
and TableB
both
Or
I should have separate Parameter
Table for both Table A
and Table B
Structure look likes this
Case I:
TableA
ID
Name
Description
TableB
ID
Name
SomeFlag
Parameter
ID
TableA_ID
TableB_ID
Name
Description
Type
Case II
TableA
ID
Name
Description
Parameter_A
ID
TableA_ID
Name
Description
Type
TableB
ID
Name
SomeFlag
Parameter_B
ID
TableB_ID
Name
Description
Type
I personally prefer Case I, as it does make sense to create another table representing same type of data.
As per normalization's concept we should have a table that represents only one thing. So i guess i should have only one parameter table. But what if that table mean something completely different when viewed from TableA and different when viewed from TableB?
I would use case one but with some changes. The parameter entity does hold one thing, parameters for a table. An instance of a parameter entry should relate to only one table (based on your analysis that they are not related).