dimanche 19 avril 2015

How to design a data model for dynamic values?

How can I model a database that supports dynamically getting the supported values of some entities based on the other entities' values?

For example, I have 5 entities namely A, B, C, D, and E. To get the supported values of entity B, I need to get first the value of entity A. But for entity E, the supported values can be retrieved by first knowing the values of entities C and D.

The values of B is dependent on the current value of A.

The values of E is dependent on the current values of C and D.

if A = 1, then B = 1.1
if A = 2, then B = 1.2
if A = 3, then B = 1.3
if C = 4 and D = 7, then E = 2.1
if C = 5 and D = 8, then E = 2.2
if C = 6 and D = 9, then E = 2.3

In short, relations can span from a simple 1-to-1 correspondence to a complex 1-to-n, n-to-1, and n-to-n relationships.


Aucun commentaire:

Enregistrer un commentaire