Post By: Hanan Mannan Contact Number: Pak (+92)-321-59-95-634 -------------------------------------------------------
ER Diagram Representation
Now we shall learn how ER Model is represented by means of ER diagram. Every object like entity, attributes of an entity, relationship set, and attributes of relationship set can be represented by tools of ER diagram.
Entity
Entities are represented by means of rectangles. Rectangles are named with the entity set they represent.
[Image: Entities in a school database]
Attributes
Attributes are properties of entities. Attributes are represented by means of eclipses. Every eclipse represents one attribute and is directly connected to its entity (rectangle).
[Image: Simple Attributes]
If the attributes are composite, they are further divided in a tree like structure. Every node is then connected to its attribute. That is composite attributes are represented by eclipses that are connected with an eclipse.
[Image: Composite Attributes]
Multivalued attributes are depicted by double eclipse.
[Image: Multivalued Attributes]
Derived attributes are depicted by dashed eclipse.
[Image: Derived Attributes]
Relationship
Relationships are represented by diamond shaped box. Name of the relationship is written in the diamond-box. All entities (rectangles), participating in relationship, are connected to it by a line.
BINARY RELATIONSHIP AND CARDINALITY
A relationship where two entities are participating, is called a binary relationship. Cardinality is the number of instance of an entity from a relation that can be associated with the relation.
One-to-one
When only one instance of entity is associated with the relationship, it is marked as '1'. This image below reflects that only 1 instance of each entity should be associated with the relationship. It depicts one-to-one relationship
[Image: One-to-one]
One-to-many
When more than one instance of entity is associated with the relationship, it is marked as 'N'. This image below reflects that only 1 instance of entity on the left and more than one instance of entity on the right can be associated with the relationship. It depicts one-to-many relationship
[Image: One-to-many]
Many-to-one
When more than one instance of entity is associated with the relationship, it is marked as 'N'. This image below reflects that more than one instance of entity on the left and only one instance of entity on the right can be associated with the relationship. It depicts many-to-one relationship
[Image: Many-to-one]
Many-to-many
This image below reflects that more than one instance of entity on the left and more than one instance of entity on the right can be associated with the relationship. It depicts many-to-many relationship
[Image: Many-to-many]
PARTICIPATION CONSTRAINTS
Total Participation: Each entity in the entity is involved in the relationship. Total participation is represented by double lines.
Partial participation: Not all entities are involved in the relation ship. Partial participation is represented by single line.
0 comments:
Post a Comment