Saturday, 23 January 2016

Modelling with ER diagram

Entity-relationship diagram

                  An entity relationship model, also called an entity-relationship (ER) diagram, is a graphical representation of entities and their relationships to each other, typically used in computing in regard to the organization of data within databases or information systems.

Entity
                   Entities are represented by means of rectangles. Rectangles are named with the entity set they represent.

Entity
Weak entity
                Weak entity is an entity that cannot be uniquely identified by its attributes alone. It could be represented by double bordered rectangle
Attributes
                Attributes are the properties of entities. Attributes are represented by means of ellipses.

Multi valued attributes
               Multi-value attributes may contain more than one value. For example, a person can have more than one phone number, email_address, etc.

Derived attributes:
           Derived attributes are the attributes that do not exist in the physical database, but their values are derived from other attributes present in the database. 
           
               For example, average_salary in a department should not be saved directly in the database, instead it can be derived. For another example, age can be derived from data_of_birth.

Key Attribute
             
Key is an attribute or collection of attributes that uniquely identifies an entity among entity set.
Examples for entity and attribute

Employee Table


Example 2 : Summary

Relationship:
                   Relationships are represented by diamond-shaped box. Name of the relationship is written inside the diamond-box.
Relationship Symbol
Weak relationship
                    A weak relationship type is represented by a double diamond. 

Weak Relationship
The following diagram is the ER-diagram of the Company Database with the specifications







No comments:

Post a Comment