DBMS ER Diagram Representation
Let us now learn how an ER diagram is used to represent the ER Model. Using an ER diagram, any object, such as entities, attributes of an entity, relationship sets, and attributes of relationship sets, can be represented.
By means of rectangles, entities are represented. Rectangles are named according to the set of entities they represent.
Attributes are entities' properties. By means of ellipses, attributes are represented. Each ellipse represents one attribute and is connected to its entity (rectangle) directly.
They are further divided into a tree like structure if the attributes are composite. Then every node is connected to its attribute. That is, ellipses that are connected with an ellipse are represented by composite attributes.
Multivalued attributes are depicted by double ellipse.
Derived attributes are depicted by dashed ellipse.
Relationships are represented by a box shaped like a diamond. In the diamond-box, the name of the relationship is written. All the entities (rectangles) that participate in a relationship are connected by a line to it.
Binary Relationship and Cardinality
A relationship is called a binary relationship where two people are involved. Cardinality is the number of instances of an entity in a relation that can be related to the relation.
- One-to-one-is marked as '1:1' when only one instance of an individual is associated with the relationship. The following image reflects that the relationship should be associated with only one instance of each entity. This represents one-to-one interaction.
- One-to-many-is identified as '1:N' when more than one instance of an entity is associated with a relationship. The following image indicates that the relationship can be related to just one instance of an entity on the left and more than one instance of an entity on the right. This depicts a one-to-many relationship.
- Many-to-one−If the relationship is associated with more than one instance of an object, it is identified as 'N:1'. The following image indicates that a relationship can be associated with more than one instance of an entity on the left and only one instance of an entity on the right. This shows many-to-one relationships.
- The following image shows that the link can be linked to more than one instance of an entity on the left and more than one instance of an entity on the right. This depicts many-to-many relationships.
- Participation Constraints
- Total Participation-The relationship involves each entity. Double lines represent the total participation.
- Partial participation-The relationship does not include all entities. Single lines represent partial participation.