Attribute in junction table depends on the primary key

30 Views Asked by At

I have a junction table to set up a many-to-many relationship between properties and their policies

The property_id and policy_id form the primary key.

As an additional attribute I wish to store a value or have a foreign key reference. The value can refer to a range of things, e.g. number of days, the fine amount, or even link to a fine amount stored in another table. So the value’s type of what it refers to isn’t consistent - this doesn’t seem right.

As an alternative, I could create multiple attributes and then keep all but one null for a given data record, however, I don’t like that as I’d have to increase the number of attributes in the table over time if other policies were ever added.

How to fix this issue?

0

There are 0 best solutions below