You are on page 1of 5

What is ER Diagram

Entity relationship diagram is used to define the relationship between


different entity which are stored in database.it helps to explain the logical
structure of database.ER diagram is similar to flowchart.we use different
symbol to represent relation with different entity.

Facts about ER Diagram

1. It allow us to design database design.


2. It is an easy to use graphical tool for modeling data

3. Mostly used for database design.

4. It is a GUI of the logical structure of database

why use ER diagram

1.Helps you to define terms related to entity relationship


modeling.

2.Provide a preview of how all your tables should connect, what


fields are going to be on each table.

3.ERD is allowed you to communicate with the logical structure


of the database to users.

4.ER diagrams can be used by database designers as a blueprint


for implementing data in specific software applications.

5.Helps to describe entities, attributes, relationships.


Components of the ER Diagram
There are different components of ER Diagram.

1. Entities
2. Attribute

3. Relationship

WHAT IS ENTITY
An entity can be place, person, object, event or a concept, which
stores data in the database.The characteristics of entities are must
have an attribute, and a unique key.

Examples of entities:

Person: Employee, Student, Patient

Place: Store, Building

Object: Machine, product, and Car

Relationship
Relationship is nothing but an association among two or more
entities. E.g., Tom works in the Chemistry department.

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
What Is data modeling

Data model define how the logical structure of the database is


Modeled.Data modals are the fundamental entities to introduce
abstraction in a database.Data model define how the data structure is
connected to each other and how they are processed and stored inside the
system.The very first data model could be flat data-models, where all the
data used are to be kept in the same plane. Earlier data models were not
so scientific, hence they were prone to introduce lots of duplication and
update anomalies.

Entity-Relationship Model
Entity-Relationship (ER) Model is based on the notion of real-world
entities and relationships among them. While formulating real-world
scenario into the database model, the ER Model creates entity set,
relationship set, general attributes and constraints.ER Model is best used
for the conceptual design of a database.
ER Model is based on −
Entities and their attributes.
Relationships among entities.
Entity − An entity in an ER Model is a real-world entity having
properties called attributes. Every attribute is defined by its set of
values called domain. For example, in a school database, a student is
considered as an entity. Student has various attributes like name, age,
class, etc.
Relationship − The logical association among entities is
called relationship. Relationships are mapped with entities in various
ways. Mapping cardinalities define the number of association between
two entities.
Mapping cardinality −
one to one
one to many
many to one,many to many

What is cardinality

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.

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.

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.
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.

You might also like