What Is ER Diagram
What Is 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:
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
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
One-to-One Relationships
One-to-Many 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 .
One-to-many:
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.