Database design help. many-to-many relationship


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.

Best Answer

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