Professional Documents
Culture Documents
Relationship
Diagrams
Entity Relationship Diagram (ERD)
An Entity Relationship Diagram (ERD) is a visual representation of data
using conventions that describe how these data elements are related to
each other.
• The writer, novel, and
consumer may be described
using ER diagrams this way:
• In the diagram, the elements
inside rectangles are called
entities (nouns) while the
items inside diamonds denote
the relationships between
entities (verbs).
2
Prof. Nitin Bolinjkar
ER Diagrams Usage
4
Prof. Nitin Bolinjkar
Entity
An entity (NOUN) can be a person, place, event, or object that is relevant to a given
system. For example, a school system may include students, teachers, major courses,
subjects, fees, and other items. Entities are represented in ER diagrams by a rectangle
and named using singular nouns.
Weak Entity
• A weak entity is an entity that
depends on the existence of
another entity.
• More specifically, it can be defined
as an entity that cannot be
identified by its own attributes.
• An entity like ‘order item’ is a good
example for this. The ‘order item’
will be meaningless without an
‘order’.
5
Prof. Nitin Bolinjkar
Attribute
An attribute is a property, trait, or characteristic of an entity, relationship, or another attribute.
For example, the attribute ‘Item Name’ is an attribute of the entity ‘Inventory Item’. An entity
can have as many attributes as necessary. Meanwhile, attributes can also have their own specific
attributes.
7
Prof. Nitin Bolinjkar
Relationship
Recursive Relationship
If the same entity participates more than
once in a relationship it is known as a
recursive relationship. In the example, an
employee can be a supervisor and be
supervised, so there is a recursive
relationship.
8
Prof. Nitin Bolinjkar
Cardinality and Ordinality
9
Prof. Nitin Bolinjkar
Types of Relationships
10
Prof. Nitin Bolinjkar
Tips on How to Draw ER Diagrams
1. Identify all the relevant entities in a given system and determine the
relationships among these entities.
2. An entity should appear only once in a particular diagram.
3. Provide a precise and appropriate name for each entity, attribute, and
relationship in the diagram.
4. In naming entities, remember to use singular nouns. However,
adjectives may be used to distinguish entities belonging to the same
class (part-time employee and full time employee, for example).
5. Attribute names must be meaningful, unique, system-independent,
and easily understandable.
6. Remove vague, redundant or unnecessary relationships between
entities.
7. Never connect a relationship to another relationship.
11
Prof. Nitin Bolinjkar
ER Diagram – Writing a Cheque
14
Prof. Nitin Bolinjkar
ER Diagram of Exam Database System
15
Prof. Nitin Bolinjkar
The End
U T
IN P
OUT
PU
T
16
Prof. Nitin Bolinjkar