I have 3 tables: Persons
, Variables
, Person_Data
.
Person_Data
table has numerical data on various variables for different persons. Columns are: variable_value
, person_id
(foreign key to Persons
) and variable_id
(fk to Variables
).
Some of the variables are related to each other (for example: Income, Family size and Per-capita-income). I want to create a Variable_Relationship
table to store this type of information and perform data sanity check. One of the column in the table would be Dependant_Variable_Id
(LHS of the relationship).
- The issue is that the number of RHS variables is not fixed and neither is the mathematical expression.
- Is there a way to implement this nicely?
Right now I am thinking about a relationship_definition
text column along with another table that has Relationship_Id
and RHS_VariableId
columns.