Hey everyone! Today, I was tasked with creating an entity relationship diagram for the COVID-19 outbreak. I included 6 entities in my diagram and included the relationships between entities and the attributes related to the entities. Here is the diagram that I made.
The entities that I chose were patient, geographic location, occupation, hospitals, behavior, and risk. The entities are represented by the rectangular boxes. The relationships between the entities that I chose are in the diamond shaped boxes. The attributes that each entity has are in the ovals.
I decided to put the patient in the middle because the patient is the only entity that relates to all of the other entities that I included. The patient has attributes of a patient number, name, age, sex/gender, and race. The patient ID is the main attribute that is going to be used to differentiate between patients because it is a primary key. Primary keys are attributes that are unique to an entity that only one can exist. All the other attributes that the patient has are foreign keys, which means that multiple entities can share these keys in common.
The other entities that I included in the diagram don't have any primary keys because they are more individualized for each person that is assessing their own unique situation. Each person that looks at the diagram for themselves could have different behaviors, occupations, hospitals, geographic locations, and risks associated with COVID-19 that they must fill out themselves. These traits that people have can overlap with other patients, making the attributes foreign keys, but help patients assess their risk with COVID-19.
Each of the entities in the the diagram can also be placed in tuples. Calling them tuples is just a fancier way of saying ordered lists that relate all the attributes and entities together. All of the entities included in my diagram can be placed into tuples. I gave some examples of tuples below.
Lastly, I included something called cardinality in my diagram. If you look at my diagram you will see 1s and Ns in the arrows that join entities together. Cardinality is the number of elements in a set as a property of that grouping. For example, 1 occupation can be located in any number of geographical location, therefore there is a 1 close to occupation before the relationship and a N after the relationship closer to the geographical location box. I included the cardinality between all of the entities in my diagram as you can see above.

Top comments (0)