Search code examples
entity-relationshipdiagram

ER diagram for a population sorting application


i am new to ER diagrams. I am creating an application for users to view and filter the yearly amount of population death tolls by attributes such as race, nationality and age. However, i cannot put all these attributes in a single entity because i don't have the required dataset to put them together. For example, i have the dataset for Table: race(Columns: Year, Race, Death Toll) and Table: age(Columns: Year, Age Group, Death Toll), however, i don't have the dataset for Table: race_age(Columns: Year, Race, Age Group, Death Toll). As a result, i have to separate these entities. I realized the death_toll attribute is repeated for all the entities so what i have done is create a ISA hierarchy. However, i find the naming convention weird and i don't know if i am right. Please check for me if i am right or wrong and guide me to the correct diagram. Thank you

enter image description here


Solution

  • If I understand your tables, they implement the functional dependencies:

    race: (Year, Race) -> Death Toll
    age: (Year, Age group) -> Death Toll
    race_age: (Year, Race, Age Group) -> Death Toll
    

    Based on that, I would build the ER model like this:

    Mortality by age and race ERD

    Your tables represent relationships between year, age group and race, with death toll an attribute of each relationship. The components of the keys identify the entities in the relationships.