0% found this document useful (0 votes)
2 views7 pages

ER PartA

An Entity Relationship Diagram (ERD) is a high-level data model that illustrates how entities relate to each other in a system, serving as a blueprint for database design. It includes components such as entities, attributes, and relationships, with distinctions between strong and weak entities, as well as various types of relationships like unary, binary, ternary, and n-ary. The ERD aids in organizing data and communicating the logical structure of the database to users.

Uploaded by

Sundari Kali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

ER PartA

An Entity Relationship Diagram (ERD) is a high-level data model that illustrates how entities relate to each other in a system, serving as a blueprint for database design. It includes components such as entities, attributes, and relationships, with distinctions between strong and weak entities, as well as various types of relationships like unary, binary, ternary, and n-ary. The ERD aids in organizing data and communicating the logical structure of the database to users.

Uploaded by

Sundari Kali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

ER (Entity Relationship) Diagram

An Entity Relationship Diagram (ERD) also referred to as Entity Relationship (ER) model. This
model illustrates how entities such as people, objects, etc. relate to each other in a system. ERD
is a high level data model used to develop the conceptual design for the database.
 In ER modeling, the database structure is portrayed as an entity-relationship diagram.

The need for ER model are as follows:


 Assisting the database developer in the design even before the construction of tables begins.
 It helps the users to plan how to organize data.
 It communicates the logical structure of the database to the users.
 An ER Diagram is considered as the blueprint of the database.
 It provides an unified view of entities, attributes, and relationships among entities
Component of ER Diagram

1. Entity
An entity may be any object, class, person or place. In the ER diagram, an entity can be
represented as rectangles. Consider an organization as an example- manager, product, employee,
department etc. can be taken as an entity.
a. Weak Entity
An entity that depends on another entity called a weak entity. The weak entity doesn't contain
any key attribute of its own. The weak entity is represented by a double rectangle.

b. Strong entity
A strong entity is an entity that is not dependent on any other entity. It has a primary key, or a table
includes a primary key.

Difference between Strong and Weak Entity

S.No. Strong Entity Weak Entity

1 It is independent in nature. It depends on another strong entity.

2 It has a primary key. It does not have any primary key.

3 It is depicted by a sole rectangle. It is depicted by a dual rectangle.

The connection between two strong entities is The connection between a weak and a strong
4
shown by a sole diamond. entity is shown by a dual diamond.

2. Attribute
The attribute is used to describe the property of an entity. Eclipse is used to represent an
attribute. For example, id, age, contact number, name, etc. can be attributes of a student.
a. Key Attribute
The key attribute is used to represent the main characteristics of an entity. It represents a primary
key. The key attribute is represented by an ellipse with the text underlined.

b. Composite Attribute

An attribute that composed of many other attributes is known as a composite attribute. The
composite attribute is represented by an ellipse, and those ellipses are connected with an ellipse.

c. Multivalued Attribute

An attribute can have more than one value. These attributes are known as a multi-valued
attribute. The double oval is used to represent multi-valued attribute. For example, a student can
have more than one phone number.

d. Derived Attribute

An attribute that can be derived from other attribute is known as a derived attribute. It can be
represented by a dashed ellipse. For example, A person's age changes over time and can be
derived from another attribute like Date of birth.
3. Relationship
A relationship is used to describe the relation between entities. Diamond or rhombus is used to
represent the relationship.
In simpler words, a relationship is defined as an association among several entities. ‘Enrolled in’
is a relationship that exists between entities Student and Course in the following illustration

A relationship set is a set of relationships of same type. Example: Set representation of above ER
diagram is-

4. Degree of Relationship Set


In DBMS, a degree of relationship represents the number of entity types that associate in a
relationship. The number of entity sets that participate in a relationship set is termed as the
degree of that relationship set. Thus,
Degree of a relationship set = Number of entity sets participating in a relationship set
The most common types of relationships are:
 Unary (one entity is involved in the relationship).
 Binary (two entities are involved in the relationship).
 Ternary (three entities are involved in the relationship)
 N-ary
a. Unary
In a relation only one entity set is participating then such type of relationship is known as a unary
relationship. So the degree of such type of relationship is 1
 Example: In a particular class, we have many students, there are monitors too. So, here class
monitors are also students. Thus, we can say that only students are participating here.

b. Binary relationships
There are two types of entity associates. So, we can say that a Binary relationship exists when
there are two types of entity and we call them a degree of relationship is 2.

Types of Binary relationships

I. One-to-One Relationship

When only one instance of an entity is associated with the relationship, then it is known as one to
one relationship. For example, when a single instance of an entity is associated with a single
instance of another entity then it is called one to one relationship. For example, a person has only
one passport and a passport is given to one person.

1 1
ASSIGNED
PERSON PASSPORT
II. One-to-many relationship

When only one instance of the entity on the left, and more than one instance of an entity on the
right associates with the relationship then this is known as a one-to-many relationship. For
example, Scientist can invent many inventions, but the invention is done by the only specific
scientist.

III. Many-to-one relationship

When more than one instance of the entity on the left, and only one instance of an entity on the
right associates with the relationship then it is known as a many-to-one relationship. For
example, Student enrolls for only one course, but a course can have many students.

IV. Many-to-many relationship

When more than one instance of the entity on the left, and more than one instance of an entity on
the right associates with the relationship then it is known as a many-to-many relationship. For
example, Employee can assign by many projects and project can have many employees.

c. Ternary (degree 3)
In the Ternary relationship, there are three types of entity associates. So, we can say that a
Ternary relationship exists when there are three types of entity and we call them a degree of
relationship is 3.
Example: We have three entity types ‘Teacher’, ‘Course’, and ‘Class’. The relationship between
these entities is defined as the teacher teaching a particular course; also the teacher teaches a
particular class. So, here three entity types are associating we can say it is a ternary relationship.
d. N-ary (n degree)
In the N-ary relationship, there are n types of entity that associates. So, we can say that an N-ary
relationship exists when there are n types of entities. There is one limitation of the N-ary
relationship, as there are many entities so it is very hard to convert into an entity, rational table.
Example: We have 5 entities Teacher, Class, Location, Salary, Course. So, here five entity types
are associating we can say an n-ary relationship is 5.

You might also like