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

Assignment

The Entity-Relationship (ER) model is a conceptual framework used to describe the structure of a database by illustrating entities, their attributes, and the relationships between them. It includes concepts such as strong and weak entities, various types of attributes, and cardinality, which defines the nature of relationships between entities. ER diagrams serve as a visual representation that simplifies database design and helps in understanding data interactions.

Uploaded by

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

Assignment

The Entity-Relationship (ER) model is a conceptual framework used to describe the structure of a database by illustrating entities, their attributes, and the relationships between them. It includes concepts such as strong and weak entities, various types of attributes, and cardinality, which defines the nature of relationships between entities. ER diagrams serve as a visual representation that simplifies database design and helps in understanding data interactions.

Uploaded by

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

Entity Relationship Model

An entity–relationship model (or ER model) describes interrelated things of interest in a


specific domain of knowledge. A basic ER model is composed of entity types (which classify
the things of interest) and specifies relationships that can exist between entities (instances of
those entity types).

An ER model usually results from systematic analysis to define and describe the data created
and needed by processes in a business area. Typically, it represents records of entities and
events monitored and directed by business processes, rather than the processes themselves. It
is usually drawn in a graphical form as boxes (entities) that are connected by lines
(relationships) which express the associations and dependencies between entities. It can also
be expressed in a verbal form, for example: one building may be divided into zero or more
apartments, but one apartment can only be located in one building.

Entities may be defined not only by relationships, but also by additional properties
(attributes), which include identifiers called "primary keys". Diagrams created to represent
attributes as well as entities and relationships may be called entity-attribute-relationship
diagrams, rather than entity–relationship models.

An ER model is typically implemented as a database. In a simple relational database


implementation, each row of a table represents one instance of an entity type, and each field
in a table represents an attribute type. In a relational database a relationship between entities
is implemented by storing the primary key of one entity as a pointer or "foreign key" in the
table of another entity.

The Entity Relationship Model is a model for identifying entities (like student, car or
company) to be represented in the database and representation of how those entities are
related. The ER data model specifies enterprise schema that represents the overall logical
structure of a database graphically.

What is Entity?

An Entity may be an object with a physical existence – a particular person, car, house, or
employee – or it may be an object with a conceptual existence – a company, a job, or a
university course.
What is Entity Set?

An Entity is an object of Entity Type and a set of all entities is called an entity set. For
Example, E1 is an entity having Entity Type Student and the set of all students is called
Entity Set. In ER diagram, Entity Type is represented as:

We can represent the entity set in ER Diagram but can’t represent entity in ER Diagram
because entity is row and column in the relation and ER Diagram is graphical representation
of data.

Types of Entity

There are two types of entity:

1. Strong Entity

A Strong Entity is a type of entity that has a key Attribute. Strong Entity does not depend on
other Entity in the Schema. It has a primary key, that helps in identifying it uniquely, and it is
represented by a rectangle. These are called Strong Entity Types.

2. Weak Entity

An Entity type has a key attribute that uniquely identifies each entity in the entity set. But
some entity type exists for which key attributes can’t be defined. These are called Weak
Entity types.
For Example, A company may store the information of dependents (Parents, Children,
Spouse) of an Employee. But the dependents can’t exist without the employee. So Dependent
will be a Weak Entity Type and Employee will be Identifying Entity type for Dependent,
which means it is Strong Entity Type.

A weak entity type is represented by a Double Rectangle. The participation of weak entity
types is always total. The relationship between the weak entity type and its identifying strong
entity type is called identifying relationship and it is represented by a double diamond.

What is Attributes?

Attributes are the properties that define the entity type. For example, Roll_No, Name, DOB,
Age, Address, and Mobile_No are the attributes that define entity type Student. In ER
diagram, the attribute is represented by an oval.

Types of Attributes

1. Key Attribute

The attribute which uniquely identifies each entity in the entity set is called the key attribute.
For example, Roll_No will be unique for each student. In ER diagram, the key attribute is
represented by an oval with underlying lines.
2. Composite Attribute

An attribute composed of many other attributes is called a composite attribute. For example,
the Address attribute of the student Entity type consists of Street, City, State, and Country. In
ER diagram, the composite attribute is represented by an oval comprising of ovals.

3. Multivalued Attribute

An attribute consisting of more than one value for a given entity. For example, Phone_No
(can be more than one for a given student). In ER diagram, a multivalued attribute is
represented by a double oval.

4. Derived Attribute
An attribute that can be derived from other attributes of the entity type is known as a derived
attribute. e.g.; Age (can be derived from DOB). In ER diagram, the derived attribute is
represented by a dashed oval.

The Complete Entity Type Student with its Attributes can be represented as:

Relationship Type and Relationship Set

A Relationship Type represents the association between entity types. For example, ‘Enrolled
in’ is a relationship type that exists between entity type Student and Course. In ER diagram,
the relationship type is represented by a diamond and connecting the entities with lines.

A set of relationships of the same type is known as a relationship set.


Degree of a Relationship Set

The number of different entity sets participating in a relationship set is called the degree of a
relationship set.

1. Unary Relationship: When there is only ONE entity set participating in a relation, the
relationship is called a unary relationship. For example, one person is married to only one
person.

2. Binary Relationship: When there are TWO entities set participating in a relationship, the
relationship is called a binary relationship. For example, a Student is enrolled in a Course.

3. Ternary Relationship: When there are three entity sets participating in a relationship, the
relationship is called a ternary relationship.
4. N-ary Relationship: When there are n entities set participating in a relationship, the
relationship is called an n-ary relationship.

What is Cardinality?

The number of times an entity of an entity set participates in a relationship set is known as
cardinality . Cardinality can be of different types:

1. One-to-One: When each entity in each entity set can take part only once in the
relationship, the cardinality is one-to-one. Let us assume that a male can marry one female
and a female can marry one male. So the relationship will be one-to-one.

the total number of tables that can be used in this is 2.


One-to-Many: In one-to-many mapping as well where each entity can be related to more than
one entity and the total number of tables that can be used in this is 2. Let us assume that one
surgeon department can accommodate many doctors. So the Cardinality will be 1 to M. It
means one department has many Doctors.

total number of tables that can used is 3.

Many-to-One: When entities in one entity set can take part only once in the relationship set
and entities in other entity sets can take part more than once in the relationship set, cardinality
is many to one. Let us assume that a student can take only one course but one course can be
taken by many students. So the cardinality will be n to 1. It means that for one course there
can be n students but for one student, there will be only one course.

The total number of tables that can be used in this is 3.

Many-to-Many: When entities in all entity sets can take part more than once in the
relationship cardinality is many to many. Let us assume that a student can take more than one
course and one course can be taken by many students. So the relationship will be many to
many.

the total number of tables that can be used in this is 3.

Participation Constraint

Participation Constraint is applied to the entity participating in the relationship set.

1. Total Participation – Each entity in the entity set must participate in the relationship. If
each student must enroll in a course, the participation of students will be total. Total
participation is shown by a double line in the ER diagram.

2. Partial Participation – The entity in the entity set may or may NOT participate in the
relationship. If some courses are not enrolled by any of the students, the participation in the
course will be partial.

The diagram depicts the ‘Enrolled in’ relationship set with Student Entity set having total
participation and Course Entity set having partial participation.
An Entity-Relationship (ER) model is a way to visually represent the structure of a database.
It shows how different entities (like objects or concepts) are connected and interact with each
other through relationships. The model uses diagrams to represent entities as rectangles and
relationships as diamonds, making it easier to design and understand databases.

What is the main purpose of an ER Diagram?

ER Diagrams are used to visually represent the structure of a database, showing entities,
their attributes, and relationships between them.

How do ER Diagrams help in database design?

They simplify the process of mapping out the database structure, making it easier to organize
data and understand how different entities interact.

What is the difference between a Weak Entity and a Strong Entity?

A Strong Entity has a unique identifier or primary key, while a Weak Entity lacks a primary
key and relies on a Strong Entity for identification.

Can ER Diagrams represent complex data relationships?

Yes, ER Diagrams can model complex relationships, including one-to-one, one-to-many, and
many-to-many relationships.

Why are Participation Constraints used in ER Diagrams?

Participation Constraints indicate whether all entities must participate in a relationship or if


only some may do so, helping to accurately represent real-world scenarios.
https://www.geeksforgeeks.org/introduction-of-er-model/

https://vertabelo.com/blog/cardinality-in-data-modeling/

https://vertabelo.com/blog/n-ary-relationship-types/

https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model

You might also like