SEMINAR PRESENTED BY
D.LEO FRANCIS
D.BALAJI
J.DINAKARAN
What are topics we are going to see in session?
WHAT IS ERD?
HISTORY OF ERD?
WHAT USE OF ERD?
Components of ER Diagram
Relationship
Weak Entities
Attributes
Cardinality
ER- Diagram Notations
Steps to Create an ERD
Best Practices for Developing Effective ER Diagrams
What is an ERD?
An entity relationship diagram (ERD) shows the
relationships of entity sets stored in a database.
An entity in this context is an object, a component of data.
An entity set is a collection of similar entities.
These entities can have attributes that define its
properties.
By defining the entities, their attributes, and showing the
relationships between them, an ER diagram illustrates the
logical structure of databases.
ER diagrams are used to sketch out the design of a
database.
HISTORY OF ERD
ER diagrams are a visual tool which is helpful to
represent the ER model. It was proposed by
Peter Chen in 1971 to create a uniform
convention which can be used for relational
database and network. He aimed to use an ER
model as a conceptual modelling approach.
Bachman was highly influential on Peter
Chen. Bachman wasn't alone in contributing to the dawn
of the Data Modelling practice. In the early 1970s, a UK-
based systems engineer for IBM, J. Barrie Leigh,
developed nascent ER diagrams for annuity system he
worked on for the Royal Insurance.
ERD REASONS OF USES
Documenting an existing database using data
There are two reasons to create a database diagram.
You're either designing a new schema or you need to
document your existing structure.
If you have an existing database you need to to
document, you create a database diagram using
data directly from your database. You can export
your database structure as a CSV file (there are some
scripts on how to this here), then have a program
generate the ERD automatically.
This will be the most accurate portrait of your
database and will require no drawing on your part.
E-R DIAGRAM CONVENTIONS
Entities, which are
represented by rectangles. An Actions, which are
entity is an object or concept represented by
about which you want to store
information. A weak entity is diamond shapes, show
an entity that must defined by
a foreign key relationship with how two entities share
another entity as it cannot be information in the
uniquely identified by its own
attributes alone database.
Why use ER Diagrams?
Here, are prime reasons for using the ER Diagram
Helps you to define terms related to entity relationship modelling
Provide a preview of how all your tables should connect, what fields are
going to be on each table
Helps to describe entities, attributes, relationships
ER diagrams are translatable into relational tables which allows you to
build databases quickly
ER diagrams can be used by database designers as a blueprint for
implementing data in specific software applications
The database designer gains a better understanding of the information
to be contained in the database with the help of ERP diagram
ERD is allowed you to communicate with the logical structure of the
database to users
Components of the ER Diagram
This model is based on three basic concepts:
Entities
Attributes
Relationships
Example
For example, in a University database, we
might have entities for Students, Courses,
and Lecturers. Students entity can have
attributes like Roll no, Name, and DeptID.
They might have relationships with Courses
and Lecturers.
A real-world thing Entity set:
either living or non-
living that is easily An entity set is a group of
recognizable and no similar kind of entities. It may
recognizable. It is
anything in the contain entities with attribute
enterprise that is to sharing similar values. Entities
be represented in our are represented by their
database. It may be a
physical thing or properties, which also called
simply a fact about attributes. All attributes have
the enterprise or an their separate values. For
event that happens in
the real world. example, a student entity may
. have a name, age, class, as
attributes
Weak Entities
A weak entity is a type of entity which doesn't
have its key attribute. It can be identified
uniquely by considering the primary key of
another entity. For that, weak entity sets need
to have participation.
In above example, "Trans No" is a
discriminator within a group of transactions in
an ATM.
DIFFERENCE BETWEEN STRONG AND WEAK
ENTITIES SETS
Attributes
It is a single-valued property of either an
entity-type or a relationship-type.
For example, a lecture might have attributes:
time, date, duration, place, etc.
An attribute is represented by an Ellipse
Cardinality & types of cardinal
relationships
Defines the numerical attributes of the
relationship between two entities or entity
sets.
Different types of cardinal relationships are:
One-to-One Relationships
One-to-Many Relationships
May to One Relationships
Many-to-Many Relationships
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 X 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 Notations
ER- Diagram is a visual representation of data that describe
how data is related to each other.
Rectangles: This symbol represent entity types
Ellipses : Symbol represent attributes
Diamonds: This symbol represents relationship types
Lines: It links attributes to entity types and entity types
with other relationship types
Primary key: attributes are underlined
Double Ellipses: Represent multi-valued attributes
Steps to Create an ERD
Following are the steps to create an ERD.
Let's study them with an example:
In a university, a Student enrols in Courses. A student
must be assigned to at least one or more Courses.
Each course is taught by a single Professor. To
maintain instruction quality, a Professor can deliver
only one course Step 1) Entity Identification
We have three entities
Student
Course
Professor
Step 2) Relationship Identification
We have the following two relationships
The student is assigned a course
Professor delivers a course
Step 3) Cardinality Identification
For them problem statement we know that,
A student can be assigned multiple courses
A Professor can deliver only one course
Step 4) Identify Attributes
You need to study the files, forms, reports, data currently
maintained by the organization to identify attributes.
You can also conduct interviews with various
stakeholders to identify entities. Initially, it's important
to identify the attributes without mapping them to a
particular entity.
Once, you have a list of Attributes, you need to map
them to the identified entities. Ensure an attribute is to
be paired with exactly one entity. If you think an attribute
should belong to more than one entity, use a modifier to
make it unique.
Step 5) Create the ERD
A more modern representation of ERD
Diagram