ER_model
ER_model
Data Requirements
Conceptual Design
Conceptual Schema
(In a high-level data model)
Logical Design
(Data Modeling and Mapping)
Physical Design
Internal Schema
➢ Entity Relationship Model or ER Model is a high-level conceptual
data model.
➢ It is used for conceptual design of database applications.
➢ This model describes the basic data structuring concepts,
relationships and constraints.
➢ The diagrammatic notions associated with ER model is known as
ER diagram.
Attributes:
The properties which describe an entity is known as attributes. For
example, an EMPLOYEE entity may be described by the employee’s
name, age, address, salary, and job.
Attributes that are not divisible are called simple or atomic attributes.
e.g., Aadhar Number or UID, Roll Number of a student, Employee ID,
Vehicle Registration Number etc.
Composite Attributes:
The attributes which can be divided into smaller subparts are known as
Composite attributes
Mname
Example: Fname
Lname
Name
The attributes have a single value for a particular entity are called
single-valued attributes.
Multivalued Attributes:
The attributes which have a set of values for the same entity is known
as Multivalued attributes.
In some cases, two (or more) attribute values are related, for example,
the Age and Birthdate attributes of a person. For a particular person
entity, the value of Age can be determined from the current (today’s)
date and the value of that person’s Birthdate.
Entity Type:
An entity type defines a collection (or set) of entities that have the same
attributes.
Each entity type in the database is described by its name and attributes.
An entity type describes the schema for a set of entities that share the
same structure.
Entity Set
The entity set is usually referred to using the same name as the entity
type.
EMPLOYEE
Key Attributes:
key attribute is one attribute or more than one attributes whose values
can be used to identify each entity in an entity type uniquely.
For example, Employee-id can be a key for EMPLOYEE entity type as no
two employee entities can have the same value for their ids.
In ER diagram each key attribute has its name underlined inside the
oval.
Eid degn
Ename
dob
Address EMPLOYEE
age
dno
mgrid
Qualification
For example,
consider a relationship type WORKS_FOR between the two entity types
EMPLOYEE and DEPARTMENT. This WORKS_FOR relationship type
associates each employee with the department for which the employee
works.
Mnam
Fname Lname
e Dname
DNo Dlocation
Eid Ename degn
WORKS_FOR DddDEPARTMENT
Addres EMPLOYEE
s
dob
Sno PrjNo
Sname Prjname
SUPPLIER PROJECT
SUPPLY Budget
Pname
PARTS
Pno
Attributes of Relationship Type:
Mname
Fname Lname
Pname
Pno
Eid Ename
WORKS_ON Project
EMPLOYEE
dob
age degn
Ploc
Hours
Mnam
Fname Lname Dno
e
Dname
Eid Ename degn
The relationship type in which same entity type participates more than
once in different roles is known as Recursive relationship or
self-referencing relationship.
Eid degn
Ename
dob
Address EMPLOYEE
age
dno
mgrid
supervisor supervisee
supervision
The possible cardinality ratios for binary relationships are 1:1, 1: N, N:1,
M: N
Mnam
Fname Lname Dno
e
Dname
Eid Ename degn
Mnam
Fname Lname Dno
e
Dname
Eid Ename degn
Addres EMPLOYEE
1 1
MANAGES DEPARTMENT
s
dob
Participation Constraints:
• The participation constraint specifies whether the existence of an
entity depends on its being related to another entity via the
relationship type.
• This constraint specifies the minimum number of relationship
instances that each entity can participate in and is sometimes
called the minimum cardinality constraint.
• There are two types of participation constraints.
➢ Total Participation Constraint
➢ Parial Participation Constraint
Total Participation Constraint:
Mnam
Fname Lname Dno
e
Dname
Eid Ename degn
Mnam
Fname Lname Dno
e
Dname
Eid Ename degn
Addres 1 1
EMPLOYEE MANAGES DEPARTMENT
s
dob
Entity types that do not have key attributes of their own are called
weak entity types.
The entity types that do have a key attribute are called Regular entity
types or strong entity types. e.g. EMPLOYEE, DEPARTMENT etc.
We call this other entity type the identifying or owner entity type.
The relationship type that relates a weak entity type to its owner entity
type is known as the identifying relationship of the weak entity type.
A weak entity type normally has a partial key, which is the attribute
that can uniquely identify weak entities that are related to the owner
entity.
ER diagram notation for Weak Entity Type:
______
___
Given below is the example of regular entity type, weak entity type and
identifying relationship