You are on page 1of 8

● Title:

Entity Relationship Diagram


● Scope

This topic will cover their usage, history, symbols, notations and how to use our ER diagram
software to draw them. ER modeling helps you to analyze data requirements systematically to
produce a well-designed database. So, it is considered a best practice to complete ER modeling
before implementing your database. In this lesson, you will learn the components of Entity
Relationship Diagram which includes Relationship, Entities, Attributes and Cardinality.

● Overview
An Entity Relationship (ER) Diagram is a type of flowchart that shows how, within a system,
"entities" such as persons , objects, or concepts relate to one another. ER Diagrams are most
commonly used in the fields of software engineering, business information systems, education
and analysis to design or debug relational databases. Also known as ERDs or ER Models, they
use a defined set of symbols such as rectangles, diamonds, ovals and connecting lines to depict
the interconnectedness of entities, relationships and their attributes. They mirror grammatical
structure, with entities as nouns and relationships as verbs.

● Objectives:
At the end of this lesson, the student must be able to:
1. Identify the basic components of Entity Relationship Diagram.
2. Familiarize to the symbols used in Entity Relationship Diagram.
3. Analyze situations and produce an Entity Relationship Diagram.

● Discussion of Topics:
Preparatory Activities:
1. Routinely Activities: Prayer, Checking of attendance
2. Motivation:

Ask the students about the love experiences. What happen to their relationships. Based to the
answer of the students connect their experiences to the cardinality used in Entity Relationship
Diagram.
3. Lesson Proper:

What is an ER diagram?

An Entity Relationship Diagram ( ERD) is a visual representation of various entities and how they relate to
each other within a structure. For example, the writer, novel, and consumer elements can be represented
the following way using ER diagrams.

History of ER Diagrams

While data modeling has become a requirement since the 1970s, no specific way of modeling databases
or business processes was found. Although several ideas have been proposed and debated none have
been widely accepted.

In his paper "The Entity Relationship Model-Toward a Unified View of Data," Peter Chen is credited with
developing the widely accepted ER model. The emphasis was on entities and relationships and he also
implemented a diagram representation for the design of databases.

His model was inspired by the data structure diagrams introduced by Charles Bachman. One of the early
forms of ER diagrams, Bachman diagrams are named after him.

Basic Elements in an ER Diagram

There are three basic elements in an ER Diagram: entity, attribute, relationship. There are more elements
which are based on the main elements. Cardinality and ordinality are two other notations used in ER
diagrams to further define relationships.
Entity

● An entity 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.

● It is “Something” of significance to the business about which data must be known.

● It is usually a person, place, thing or event.

Entities can be:

1. Tangible, like PERSON or PRODUCT


2. Non-tangible, like REQUIRED SKILL LEVEL
3. An event, like PURCHASE
4. Entities have instances.

Example:

● PERSON Juan dela Cruz


● PRODUCT 2.5 x 35 mm copper nail
● JOB teacher
● PURCHASE the cd I bought yesterday
● SKILL fluent in English

 An entity represents a set of instances that are of interest to a particular business.

Attribute

● An attribute is a property, trait, or characteristic of an entity, relationship, or another attribute. For


example, the attribute Inventory 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. For example, the attribute “customer address” can have the attributes number, street,
city, and state. These are called composite attributes. Note that some top level ER diagrams do
not show attributes for the sake of simplicity. In those that do, however, attributes are represented
by oval shapes.
● A single valued property detail of
an entity. An entity instance can have only one value.
● A specific piece of information that describes, quantifies, qualifies, classifies, and specifies an
entity.
● Every attribute has a data type. It can be a number, a character string, a date, an image, a sound
and even more.

Example

● EMPLOYEE Family Name, Age, Address, Email,…


● CAR Model, Weight, Price,…
● ORDER Order Date, Ship Date,…
● JOB Title, Description,…
● TRANSACTION Amount,Transaction Date
● EMPLOYMENT Start Date, Salary,…

Relationship

● Express how entities are mutually related


● Always exist between two entities
● Always have two perspectives
● Are named at both ends

● A relationship describes how entities interact. For example, the entity “Carpenter” may be related
to the entity “table” by the relationship “builds” or “makes”. Relationships are represented by
diamond shapes and are labeled using verbs.
Using Relationships in Entity Relationship Diagrams

Examples:

● EMPLOYEES have JOBS


● JOBS are held by EMPLOYEES
● PRODUCTS are classified by a PRODUCT TYPE
● PRODUCT TYPE is a classification for a PRODUCT
● Relationships show in connecting lines with crows foot indicating the cardinality, one is to one,
one is to many, many is to many.

ER Diagram Symbols

Cardinality

● Defines the numerical attributes of the relationship between two entities or entity sets.
The three main cardinal relationships are one-to-one, one-to-many, and many-many.

● Cardinality views: Cardinality can be shown as look-across or same-side, depending on


where the symbols are shown.

● Cardinality constraints: The minimum or maximum numbers that apply to a relationship.

Cardinality Symbols
1.One-to-one:

One entity from entity set X can be associated with at most one entity of entity set Y and vice versa.

Example: One student can register for numerous courses. However, all those courses have a single line
back to that one student.

2.One-to-many:

One entity from entity set X can be associated with multiple entities of entity set Y, but an entity from
entity set Y can be associated with at least one entity.

For example, one class is consisting of multiple students.

3. Many to One

More than one entity from entity set X can be associated with at most one entity of entity set Y. However,
an entity from entity set Y may or may not be associated with more than one entity from entity set X.

For example, many students belong to the same class.


4. Many to Many:

One entity from X can be associated with more than one entity from Y and vice versa.

For example, Students as a group are associated with multiple faculty members, and faculty members
can be associated with multiple students.

ER Diagram Best Practices

● Provide a specific name, attribute and relationship for each object in the diagram. Clear,
recognizable terms often beat obscure, technical-sonic phrases. Recall using singular
nouns when naming things. Adjectives can also be used to differentiate individuals
belonging to the same class (for example, part-time employee and full-time
employee).Meanwhile attribute names must be meaningful, unique, system-independent,
and easily understandable.
● Remove vague, redundant or unnecessary relationships between entities.
● Never connect a relationship to another relationship.
● Make effective use of colors. You can use colors to classify similar entities or to highlight
key areas in your diagrams.
● References:

1. Web Scripting Third Edition, Emmanuel Kazanidis, M.SC., Florida Valencia Ortiz,
Mai Ryza D. Amante, M.A, Stephen C. De Sagun, Jaime D.L. Caro, Ph.D.
2. Online Resources: https://www.lucidchart.com/pages/er-diagrams

3. Online Resources: https://www.guru99.com/er-diagram-tutorial-dbms.html

4. Online Resources: https://creately.com/blog/diagrams/er-diagrams-tutorial/

You might also like