ER Diagram
ER Diagram
And Notations
E-R diagrams are used to model real-world objects like a person, a car, a company etc.
and the relation between these real-world objects. An e-r diagram has following
features:
E-R diagrams are used to represent E-R model in a database, which makes them easy to
be converted into relations (tables).
E-R diagrams provide the purpose of real-world modeling of objects which makes them
intently useful.
E-R diagrams require no technical knowledge & no hardware support.
These diagrams are very easy to understand and easy to create even by a naive user.
It gives a standard solution of visualizing the data logically.
Entity
Entities can be characterized into two types:
Strong entity: A strong entity has a primary key attribute which uniquely identifies
each entity. Symbol of strong entity is same as an entity.
Strong Entity
Weak entity: A weak entity does not have a primary key attribute and depends on
other entity via a foreign key attribute.
Weak Entity
B. Attribute:- Each entity has a set of properties. These properties of each entity are
termed as attributes. For example, a car entity would be described by attributes such as
price, registration number, model number, color etc. Attributes are indicated by ovals in
an e-r diagram.
Attribute
A primary key attribute is depicted by an underline in the e-r diagram. An attribute can
be characterized into following types:
Composite Attribute
Derived attribute: A derived attribute calculate its value from another attribute. For
example, „age‟ is a derived attribute if it calculates its value from „current date‟ & „birth
date‟ attributes. A derived attribute is represented by a dashed oval.
For example,
Relationship
Other types of relationships are ternary and quaternary. As the name signifies, a ternary
relationship is associated with three entities and a quaternary relationship is associated
with four entities.
b.) Connectivity of a relationship:- Connectivity of a relationship describes, how
many instances of one entity type are linked to how many instances of another entity
type. Various categories of connectivity of a relationship are;
One To One
One to Many
Many to One (M:1) – “Many houses are owned by a person” is a many-to-one
relationship because a person can own many houses but a particular house is
owned only a person.
Many To One
Many To Many
Sample ER DIGRAM
ER diagram Railway Reservation System