ER-Diagram Tutorial Flashcards
What is participation, and what is it also known as?
Modality, multiplicity, and it indicates whether all or only some of the instances of the entity are involved in the relationship.
What is cardinality?
It indicates the number of instances of the entities in a given relationship
Where should the foreign key go in a 1-1 (M:O) relationship?
The foreign key should go in the mandatory entity.
Where should the foreign key go in a 1-1 relationship if they’re both mandatory or both optional
Does not matter where foreign key goes.
Where should the foreign key go in a many-to-one relationship?
Should go in the entity that has only ONE of the other entity (with the multiple crows feet touching it)
Where should the foreign key go in a many-to-many relationship?
A new (connector) ENTITY must be created (with lowercase name), and both foreign keys are put inside this new entity.
Describe how the crow’s feet diagram would work in a Many-to-Many relationship scenario.
The crow’s feet touching the original entities should be 1 (M), and the feet touching the connector entity should be Many but the optionality depends on relationship.
What are the steps to Designing an E-R Model/diagram?
- Collect & review all data
- Identity entities and attributes, draw them
- Identify KEYs and underline them
- Decide on relationships and draw them, including the attributes OF RELATIONSHIPS
- Decide on cardinality, participation
- Add foreign keys for each entity and add relationship attributes (if present).
- Resolve relationship attributes
Where should relationship attributes go in a 1:M relationship?
With the foreign key, or the entity that’s getting touched by multiple feet.
Where should relationship attributes go in a M:M relationship?
In the connector identity.