You are on page 1of 16

Database Management

Systems

SUBJECT TEACHER: PRIYA SACHDEVA,ASSISTANT PROFESSOR (CSE)


Entity-Relationship Model
It describes the structure of a database.

It is a design or blueprint of a database that can later


be implemented as a database.

It displays the relationships of entity set stored in a


E-R Model database. In other words, ER diagrams help you to
explain the logical structure of databases.
At first look, an ER diagram looks very similar to the
flowchart.

It is a high-level data model.


A simple ER Diagram

Rectangle: Entity sets


Ellipses: Attributes
Diamonds: Relationship Set
Lines: Link attributes to
Entity Sets &
Entity sets to Relationship Set
Components of ER Model
Entity
An entity can be a real-world object, that can be easily identifiable. All entities have some
attributes or properties that give them their identity.
An entity set is a collection of similar types of entities.
Attribute
Entities are represented by means of their properties known as Attribute. There exists a
domain or range of values that can be assigned to attributes.
Relationship
The association among entities is called a Relationship.
A set of relationships of similar type is called a relationship set.
Like entities, a relationship too can have attributes. These attributes are called Descriptive
Attributes.
The number of participating entities in a relationship defines the Degree of the Relationship.
Types of Attributes
•Simple attribute− Simple attributes are atomic values, which cannot be divided further.
For example, a student's phone number is an atomic value of 10 digits

•Composite attribute− Composite attributes are made of more than one simple attribute.
For example, a student’s address may have hno, street, city, state, pincode etc.
•Single-value attribute− Single-value attributes contain single value. For example,
Social_Security_Number.

•Multi-value attribute− Multi-value attributes may contain more than one values. For
example, a person can have more than one phone number, email_address.

Derived attribute− Derived attributes are the attributes that do not exist in the physical
database, but their values are derived from other attributes present in the database. For
example, average_salary in a department should not be saved directly in the database,
instead it can be derived. Age can be derived from data_of_birth.
Key Attribute-
This attribute uniquely identifies each
entity in the entity set. For example,
Roll_No will be unique for each
student. In ER diagram, key attribute is
represented by an oval with underlying
lines.
Connectivity and Cardinality
ONE-TO-ONE 1:1 ONE-TO-MANY 1:N
Connectivity and Cardinality
MANY-TO-ONE N:1 MANY-TO-MANY N:N
Participation Constraints
•Total Participation− Each entity is involved in the relationship. Total
participation is represented by double lines.
•Partial Participation− Not all entities are involved in the relationship. Partial
participation is represented by single lines.
Types of Relationship Set
Weak Entity Set
•The entity sets which do not have sufficient attributes to form a Primary Key are known
as Weak entity sets and the entity sets which have a Primary key are known as Strong
entity sets.
•Weak entities cannot be identified on their own, so they depend on some other entity.
• They have total participation constraint in its identifying relationship with owner
identity.
•Weak entity types have partial keys. Partial Keys are set of attributes with the help of
which the tuples of the weak entities can be distinguished and identified.
•Weak entity is dependent on strong entity to ensure the existence of weak entity.
•Weak entity is represented by double rectangle. The relation between one strong and one
weak entity is represented by double diamond.
E-R Notations

You might also like