I have four columns. All columns are varchar fields. Three of them are independent and distinct fields having many to many relation between them and the fourth one is dependent on the combination of first three. so for all the combinations of three columns there is different value for the fourth column. Now I want a design for data like this. Any help is appreciated.

  • 1
    if value 4 is dependent on the other columns then it becomes a computed or derived value. Create some code/business logic to calculate it and do not store it at all. – kevinskio Jul 4 '16 at 17:36

Just have a table with a composite primary key on value1, value2, value2

If any of the 3 are restricted then have FK relationship on the column

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.