Changes

Jump to navigation Jump to search
79 bytes added ,  23:18, 9 February 2023
Line 48: Line 48:     
Each primary key (disease) can be associated with multiple values in each attribute. For example, CAD is associated with multiple risk factors (age, male gender, smoking, etc) and multiple symptoms (angina, dyspnea, nausea, etc). At the same time, each of these risk factors and symptoms are associated with other diseases besides CAD. For example, smoking is a risk factor for CAD, lung cancer, PVD, COPD, head and neck cancer, etc. In order to handle this many-to-many cardinality of the data, multiple base tables should be created and an associative table (junction table) can then be created as needed. The base tables in the above example would be:
 
Each primary key (disease) can be associated with multiple values in each attribute. For example, CAD is associated with multiple risk factors (age, male gender, smoking, etc) and multiple symptoms (angina, dyspnea, nausea, etc). At the same time, each of these risk factors and symptoms are associated with other diseases besides CAD. For example, smoking is a risk factor for CAD, lung cancer, PVD, COPD, head and neck cancer, etc. In order to handle this many-to-many cardinality of the data, multiple base tables should be created and an associative table (junction table) can then be created as needed. The base tables in the above example would be:
{| class "wikitable"
+
{| class="wikitable"
 
|+ Base Table 1
 
|+ Base Table 1
|
+
|-
! Disease (PK)
+
| Disease (PK)
 
|-
 
|-
 
| Risk factors
 
| Risk factors
 
|}
 
|}
 +
 +
{| class="wikitable"
 +
|+ Base Table 2
 +
|-
 +
| Risk factors (PK)
 +
|-
 +
| Disease
 +
|}
 +
 
Disease < Symptom < Disease
 
Disease < Symptom < Disease

Navigation menu