You are on page 1of 15

ENTITY RALATIONSHIP

(E-R) MODEL

PRESENTED BY :
SUMIT CHOUDHRY
SOURAV TIWARY
SRIRAM SHARMA
UDAYRAJ GIRI
UDYOTTA KESHARI
INTRODUCTION

E-R model was introduce by P.P CHEN in 1976.


E-R model is an effective and standard method of
communication amongest different designers, programmers
and end users.
E-R modeling is a high level conceptual data model developed
to facilitate database design.
It is very useful in mapping the meaning and interaction of
real world enterprise onto a conceptual schema.
E-R model provides the following three main semantic
concept to the designer:

ENTITIES: Which are distinct objects in a user enterprise.

RELATIONSHIP : Which are meaningful interaction among the objects

ATTRIBUTES: Which describe the entities and relationships. Each such


attributes is associated with a value set(Also called domain)
and can take a value from this value set.

CONSTRAINTS: On the entities, Relationships and attributes.


Entity Relationship Model

 Based on collection of real world objects or concept called


entities; ex: employee, student
 attribute represents properties of entity; s.s.num
relationship represents interaction between entities
 overall logical structure represented by E-R diagram
representing entity sets,
relationships, attributes
ER Model Definitions

ENTITY: REAL-WORLD OBJECT DISTINGUISHABLE FROM OTHER


OBJECTS.
AN ENTITY IS DESCRIBED (IN DB) USING A SET OF ATTRIBUTES.
ENTITY SET: A COLLECTION OF SIMILAR ENTITIES. E.G., ALL
EMPLOYEES.
ALL ENTITIES IN AN ENTITY SET HAVE THE SAME SET OF ATTRIBUTES.
(UNTIL WE CONSIDER ISA HIERARCHIES, ANYWAY!)
EACH ENTITY SET HAS A KEY.
EACH ATTRIBUTE HAS A DOMAIN.
REPRESENTATION/SYNTAX:
ENTITY SET REPRESENTED BY RECTANGLE
ATTRIBUTE REPRESENTED BY OVAL
KEY ATTRIBUTE UNDERLINED
ER Model Basics (Contd.)
RELATIONSHIP: ASSOCIATION AMONG TWO OR MORE ENTITIES.
E.G., DAN TAKES DATABASE COURSE; ATTISHOO WORKS IN
PHARMACY DEPARTMENT.
.RELATIONSHIP CAN ALSO HAVE ATTRIBUTES (THAT APPEAR ONLY FOR THIS
RELATIONSHIP SET)
REPRESENTATION/SYNTAX: A DIAMOND SYMBOL
. ATTRIBUTES REPRESENTED BY OVAL (SAME AS BEFORE)
RELATIONSHIP SET: COLLECTION OF SIMILAR RELATIONSHIPS.
. AN N-ARY RELATIONSHIP SET R RELATES N ENTITY SETS E1 ... EN; EACH
RELATIONSHIP IN R INVOLVES ENTITIES E1 ∈ E1, ..., EN ∈ EN
. SAME ENTITY SET COULD PARTICIPATE IN DIFFERENT RELATIONSHIP
SETS, OR IN DIFFERENT “ROLES” IN SAME SET.
SYMBOLS OF E-R DIAGRAM

(Entity set)
(Attributes)

(Link between attribute


and entity set )

(Relationship)
SYMBOLS OF E-R DIAGRAM

(Mandatory one) (Mandatory many)

(Optional one) (Optional many)


Connectivity in the E-R Diagram

. ATTRIBUTES CAN ONLY BE CONNECTED TO ENTITIES OR


RELATIONSHIPS.

. ENTITIES CAN ONLY BE CONNECTED VIA RELATIONSHIPS

. AS FOR THE EDGES, LET’S CONSIDER KINDS OF RELATIONSHIPS


AND INTEGRITY CONSTRAINTS…

PROFESSORS TEACHES COURSES


E-R diagram for M/s ABC & Co

CUST_ID CUST_NAME CUST_ADRESS

CUSTOMER

PROD_DESC

PROD_ID UNIT_COST
SUBMITS

REQUESTS PRODUCT
ORDER

ORD_DATE
PROD_ID PROD_QTY
Constraints – Key and Participation

.CAPTURE PROPERTIES OF THE RELATIONSHIP AND ENTITIES

. EVERY ENTITY SET HAS A KEY ATTRIBUTE


. NO TWO ELEMENTS CAN HAVE THE SAME VALUE ON THIS ATTRIBUTE
• EXAMPLE: STUDENT ID

. DOES EVERY ELEMENT IN THE ENTITY SET APPEAR/PARTICIPATE IN


THE RELATIONSHIP ?
. MUST EVERY STUDENT TAKE A COURSE ?

. DEFINE CONSTRAINTS BASED ON PROPERTIES OF THE


MAPPING/RELATION BETWEEN ENTITY SETS
Properties of relations

. BINARY RELATIONSHIPS CAN BE CLASSIFIED AS ONE


TO-ONE, MANY-TO-ONE, ONE-TO-MANY, MANY-TO
MANY
. WHAT IS THE TYPE OF MAPPING/RELATION

. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
1-TO-1 1-TO-MANY MANY-TO-1 MANY-TO-MANY
ADVANTAGES OF E-R DATA MODEL

STRAIGHT FORWARD RELATIONAL REPRESENTATION: Having designed


an E-R diagram for a database application, the relational representation
of the data base model becomes relatively straightforward.
EASY CONVERSION FOR E-R TO OTHER DATA MODEL: Conversion from
E-R diagram to a network or hierarchical data model can easily be
accomplished.
GRAPHICAL REPRESENTATION FOR BETTER UNDERSTANDING: An E-R
model gives graphical and diagrammatical representation of various
entities, its attributes and relationships between entities. This is turn
helps in the clear understanding of the data structure and in minimizing
redundancy and other problems.
DISADVANTAGES OF E-R DATA MODEL

NO INDUSTRY STANDARD FOR NOTATION: there is no industry


standard notation for Developing an E-R diagram.
POPULAR FOR HIGH-LEVEL DESIGN: The E-R model is especially
popular for high level data base design.
O U
K Y
A N
T H

You might also like