SlideShare a Scribd company logo
The schema for database application displayed by
graphical notation . It mainly comprises :
• Entity and its attributes
• Relationship, which is association among entities
Ideas ER Design Relational Schema
Relational DBMS
Implementation
Entity types represent collection of entities that
have same attributes and are pictured by
rectangular nodes. Basically the relation name.
Weak – Entity
Types
A Relationship type R among entities types
defines a set of associations.
Relationship types associate entity types. They
are pictured by Diamond nodes.
• Create a new relation.
• Include the simple attributes
• Include the simple components of the composite
attributes
• Identify the primary keys. If the chosen key is
composite, the set of simple attributes that form
it will together form the primary key.
• Don’t include: non-simple components of
composite attributes, foreign keys, derived
attributes.
• Create a new relation.
• Include simple attributes
• Add the owner’s primary key attributes, as
foreign key attributes
• Declare into a primary key the partial keys of the
weak entity type combined with those imported
from the owner
There are Three possible approaches:
1) Foreign key approach
2) Merged relation option
3) Cross-reference or relationship relation
option
1) Foreign Key approach
• Identify the relations S and T that correspond to
the entity types participating in R.
• Include as foreign keys, in the relation of one
entity type, the primary keys of the other entity
type
• The entity having total participation must have
the foreign key of the other entity.
• Include also the simple attributes of the
relationship type
DEPARTMENT has total participation. Therefore,
DEPARTMENT contains the foreign key, the
primary key of EMPLOYEE.
Example :
2) Merged relation option:
• Merge the two entity types and the relationship
into a single relation.
• This may be appropriate when both
participations are total.
3)Cross-reference or relationship
relation option:
• Create a third relation R for the purpose of
cross-referencing the primary keys of the two
relations S and T representing the entity types.
• Add as foreign keys, to the relation of the entity
type at the N side, the primary keys of the entity
type at the 1 side (don’t duplicate records!)
• Include also the simple attributes of the
relationship type
• Create a new relation.
• Add as foreign keys the primary keys of the
participating entity types to the relationship
type(their combination will form the primary
key)
• Include the simple attributes of the relationship
type
• Create a new relation
• Include the given attribute
• Include as foreign keys the primary attributes of
the entity/relationship type owning the
multivalued attribute.
• The primary key is combination of the attribute
as well as the foreign key.
• If the multivalued attribute is composite, we
include its simple components.
Example:
• The relation DEPT_LOCATIONS is created.
• The attribute DLOCATION represents the
multivalued attribute.
• LOCATIONS of DEPARTMENT, while
DNUMBER-as foreign key-represents the primary
key of the DEPARTMENT relation.
• The primary key is the combination of
{DNUMBER,DLOCATION}.
 Includes all modeling concepts of basic ER
 Additional concepts: subclasses/superclasses,
specialization/generalization, categories,
attribute inheritance
 The resulting model is called the enhanced-
ER or Extended ER (E2R or EER) model
 It is used to model applications more
completely and accurately if needed
 It includes some object-oriented concepts,
such as inheritance
An entity type may have additional meaningful
subgroupings of its entities
Example: EMPLOYEE may be further grouped into
SECRETARY, ENGINEER, MANAGER, TECHNICIAN,
SALARIED_EMPLOYEE, HOURLY_EMPLOYEE
 Each of these groupings is a subset of EMPLOYEE
entities
 Each is called a subclass of EMPLOYEE
 EMPLOYEE is the superclass for each of these
subclasses
These are called superclass/subclass relationships.
Example
An entity that is
member of a
subclass
represents the
same real-world
entity as some
member of the
superclass
 An entity that is member of a subclass inherits
all attributes of the entity as a member of the
superclass
 It also inherits all relationships
• Is the process of defining a set of subclasses of a
superclass
• May have several specializations of the same superclass
Example :
{SECRETARY, ENGINEER, TECHNICIAN} is a
specialization of EMPLOYEE based upon job type.
Another specialization of EMPLOYEE based in method of
pay is {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE
• Attributes of a subclass are called specific attributes
The subset symbol
on each line
connecting a
subclass to the
circle indicates
direction of the
superclass/subclass
relationship.
Example of Specialization
 The reverse of the specialization process
 Several classes with common features are
generalized into a superclass; original classes
become its subclasses
Example: CAR, TRUCK generalized into
VEHICLE; both CAR, TRUCK become subclasses
of the superclass VEHICLE.
 Both Specializations and Generalizations are shown in
rectangles in EER diagrams (as are entity types)
a) Predicate-defined - The subclass is defined
through a predicate on the attributes of the
superclass
Defining
predicate of
the Sub class
EMPLOYEE
d
Salaried
employee
Hourly_employee
Salary > 30000Hours<6
b) Attribute-defined - The subclasses in the
specialization are all defined by the same attribute
of the superclass
c) User-defined – Membership determined
during insertion
Defining
attribute of the
Super class
Disjoint (d)
The subclasses must have disjoint sets of entities
Overlap (o)
The subclasses may have overlapping sets of entities
Partial - An entity may not belong to any of the
subclasses. Represented by
Total - Every entity in the superclass must be a member
of some subclass. Represented by
Disjointness and completeness constraints are independent
Note: Generalization usually is total because the
superclass is derived from the subclasses
 Every subclass participates as a subclass in only one
class/subclass relationship
 Single Inheritance
 Results in a tree structure or strict hierarchy
PURCHASED
d
WHOLESALERETAIL
COOKIE
HOME-MADE
d
Subclass can be a subclass in more than one class/subclass
relationship
 Multiple Inheritance
 Also called Shared subclasses
In a lattice or
hierarchy, a
subclass inherits
attributes not
only of its direct
superclass, but
also of all its
predecessor
superclasses
 Subclass related to a collection of superclasses
 Each instance of subclass belongs to one, not
all of the superclasses
 Superclasses form a union
 Category can be total or partial
 Subclass is called a category or UNION TYPE
Note: The difference from shared subclass is that the
member must exist in all of its superclasses).
Example of
Partial Union
U
Example of
Total Union
To Convert each Specialization and Generalized Superclass into
a relational schema :
a. Multiple relations-Superclass and subclasses
b. Multiple relations-Subclass relations only
c. Single relation with one type attribute
d. Single relation with multiple type attributes
NOTATION :
Super class : C Primary Key : K Attributes : A(i)
Sub class : S
Relation : L
a.Multiple relations-Superclass and
subclasses
 Create a relation L for C with attributes
Attrs(L) = {K, A1, A2, …, An} and PK(L) = K.
 Create a relation Li for each subclass Si, 1 < i < m,
with the attributes
ATTRS(Li) = {K} U {attributes of Si} and
PK(Li) = K.
 This option works for any constraints: disjoint or
overlapping; total or partial.
b. Multiple relations-Subclass relations
only
 Create a relation Li for each subclass Si, 1 < i < m, with
ATTRS(Li) = {attributes of Si} U {K, A1, A 2, …, An }
PK(Li) = K
 This option works well only for disjoint and total
constraints.
 If the specialization is overlapping, the same entity may be
duplicated in several relations.
 If not total, entity not belonging to any sub-class is lost.
d
Tonnage
c. Single relation with one type attribute
 Create a single relation L with attributes Attrs(L) = {K,
A1, …, A n} U {attributes of S1} U… U {attributes of S
m} U {T} and PK(L)=K
 This option is for specialization whose subclasses are
DISJOINT, and T is a type/discriminating attribute
that indicates the subclass to which each tuple belongs,
if any. This option may generate a large number of null
values.
 Not recommended if many specific attributes are
defined in subclasses (will result in many null values!)
Attribute-
defined
specialization
on Jobtype
d. Single relation with multiple type
attributes
 Create a single relation schema L with attributes
Attrs(L) = {K, A1, …, A n} U {attributes of S1} U…
U {attributes of Sm} U {T1, …, T n} and PK(L)=K
 This option is for specialization whose subclasses
are overlapping, and each Ti, 1 < i < m, is a
Boolean attribute indicating whether a tuple
belongs to subclass Si.
o
Approach Pre-conditions Considerations Trade-off
A(Super and Sub
relations)
None Most flexible but
incurs a join cost
B(Sub relations) Specialization
must be total
Specialization
must be disjoint
In order to query
all entities of the
supertype one
must OUTER
UNION the
subtype relations
(and project to
Attr(C),
technically)
C (One relation,
one type)
Specialization
must be disjoint
If one table is
desirable
Potential for a
large NULL cost
D (One relation,
Multiple type)
None One table is
desired but
specialization is
overlapping
Also very flexible
but incurs a NULL
cost
 All the Superclasses and the subclass must have
the same primary key. Otherwise model as a
Category
 Apply any of the options discussed in
Generalization/Specialization mapping(former
topic)
 For mapping a category whose defining superclass have
different keys, it is customary to specify a new key
attribute, called a surrogate key, when creating a relation
to correspond to the category.
 Let C₁,C₂,…,Cm be the entity types participating in the
union and S be the union type. Create a relation for S and
surrogate key ks so that PK(S)=ks, and also add ks to
each Attr(Ci) as a foreign key into S. If all the Cis have the
same primary key type, use that as PK(S) instead.
Websites :
• http://web.cse.ohiostate.edu/~gurari/course/cs
e670/
• http://home.iitj.ac.in/~ramana/ch7-
mappingER-EER-relations.pdf
• http://jcsites.juniata.edu/faculty/rhodes/dbms/
eermodel.htm
• http://www.cs.montana.edu/~halla/csci440/n9
/n9.html
Mapping ER and EER Model

More Related Content

What's hot

Chapter-4 Enhanced ER Model
Chapter-4 Enhanced ER ModelChapter-4 Enhanced ER Model
Chapter-4 Enhanced ER Model
Kunal Anand
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
sontumax
 
ER MODEL
ER MODELER MODEL
ER MODEL
Rupali Rana
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
Shishir Aryal
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
Saranya Natarajan
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
VENNILAV6
 
Object diagram
Object diagramObject diagram
Object diagram
Rahul Pola
 
Primary Key & Foreign Key part10
Primary Key & Foreign Key part10Primary Key & Foreign Key part10
Primary Key & Foreign Key part10
DrMohammed Qassim
 
1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
BHARATH KUMAR
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
Nishant Munjal
 
Types and roles
Types and rolesTypes and roles
Types and roles
Satyamevjayte Haxor
 
Object diagram
Object diagramObject diagram
Object diagram
Preeti Mishra
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
Akanksha Jaiswal
 
Fundamentals of Database system
Fundamentals of Database systemFundamentals of Database system
Fundamentals of Database system
philipsinter
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and DesignHaitham El-Ghareeb
 

What's hot (20)

Chapter-4 Enhanced ER Model
Chapter-4 Enhanced ER ModelChapter-4 Enhanced ER Model
Chapter-4 Enhanced ER Model
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Domain model
Domain modelDomain model
Domain model
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 
Object diagram
Object diagramObject diagram
Object diagram
 
Primary Key & Foreign Key part10
Primary Key & Foreign Key part10Primary Key & Foreign Key part10
Primary Key & Foreign Key part10
 
1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
 
Relational model
Relational modelRelational model
Relational model
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
Types and roles
Types and rolesTypes and roles
Types and roles
 
Object diagram
Object diagramObject diagram
Object diagram
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Fundamentals of Database system
Fundamentals of Database systemFundamentals of Database system
Fundamentals of Database system
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 

Viewers also liked

ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING ARADHYAYANA
 
EER Model
EER ModelEER Model
EER Model
Rahul Mukherjee
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
Enhanced E-R diagram
Enhanced E-R diagramEnhanced E-R diagram
Enhanced E-R diagramMayank Jain
 
Erd examples
Erd examplesErd examples
Erd examples
Pramod Redekar
 
Erd practice exercises
Erd practice exercisesErd practice exercises
Erd practice exercises
Jennifer Polack
 
D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3askme
 
Mapping in database
Mapping in databaseMapping in database
Mapping in database
Esmatullah Adel
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database designElias Dinsa
 
Logical database design and the relational model(database)
Logical database design and the relational model(database)Logical database design and the relational model(database)
Logical database design and the relational model(database)welcometofacebook
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraints
Nikhil Deswal
 
Er diagram practical examples
Er diagram practical examplesEr diagram practical examples
Er diagram practical examplesRahul Khanwani
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
Mudasir Qazi
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Shakila Mahjabin
 
Entity Relationship Diagram of Library System
Entity Relationship Diagram of Library SystemEntity Relationship Diagram of Library System
Entity Relationship Diagram of Library System
Abdul Rahman Sherzad
 
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Beat Signer
 

Viewers also liked (20)

ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
 
Crj 3 1-b
Crj 3 1-bCrj 3 1-b
Crj 3 1-b
 
EER Model
EER ModelEER Model
EER Model
 
enhanced er diagram
enhanced er diagramenhanced er diagram
enhanced er diagram
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
Enhanced E-R diagram
Enhanced E-R diagramEnhanced E-R diagram
Enhanced E-R diagram
 
Enhanced ER(database)
Enhanced ER(database)Enhanced ER(database)
Enhanced ER(database)
 
Erd examples
Erd examplesErd examples
Erd examples
 
Erd practice exercises
Erd practice exercisesErd practice exercises
Erd practice exercises
 
D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3
 
Mapping in database
Mapping in databaseMapping in database
Mapping in database
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database design
 
Logical database design and the relational model(database)
Logical database design and the relational model(database)Logical database design and the relational model(database)
Logical database design and the relational model(database)
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraints
 
Er diagram practical examples
Er diagram practical examplesEr diagram practical examples
Er diagram practical examples
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Entity Relationship Diagram of Library System
Entity Relationship Diagram of Library SystemEntity Relationship Diagram of Library System
Entity Relationship Diagram of Library System
 
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
 

Similar to Mapping ER and EER Model

27 f157al5enhanced er diagram
27 f157al5enhanced er diagram27 f157al5enhanced er diagram
27 f157al5enhanced er diagram
dddgh
 
ch3 final.pptx
ch3 final.pptxch3 final.pptx
ch3 final.pptx
munnamicheal
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
IshuIswarya3
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural Modeling
AMITJain879
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
CheriviralaNikhil
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
Raj vardhan
 
SW SEC 1.pptx
SW SEC 1.pptxSW SEC 1.pptx
SW SEC 1.pptx
abdohanfi1
 
RDBMS ER2 Relational
RDBMS ER2 RelationalRDBMS ER2 Relational
RDBMS ER2 RelationalSarmad Ali
 
27f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp0227f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp02
marangburu42
 
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptxdata base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
mulukendemis44
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
Raj Thilak S
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
fanta teferi
 
ECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptx
miftah88
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
ThangamaniR3
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]
Bashir Rezaie
 
ER model
ER modelER model
ER model
ShilpaDe
 
3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdf
fikadumola
 
Relationships and their representation in a class diagram.pptx
Relationships and their representation in a class diagram.pptxRelationships and their representation in a class diagram.pptx
Relationships and their representation in a class diagram.pptx
nesarahmad37
 
Relational algebra calculus
Relational algebra  calculusRelational algebra  calculus
Relational algebra calculus
Vaibhav Kathuria
 
classdiagram.pptx
classdiagram.pptxclassdiagram.pptx
classdiagram.pptx
RahulGautam663736
 

Similar to Mapping ER and EER Model (20)

27 f157al5enhanced er diagram
27 f157al5enhanced er diagram27 f157al5enhanced er diagram
27 f157al5enhanced er diagram
 
ch3 final.pptx
ch3 final.pptxch3 final.pptx
ch3 final.pptx
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
Advanced Structural Modeling
Advanced Structural ModelingAdvanced Structural Modeling
Advanced Structural Modeling
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
 
SW SEC 1.pptx
SW SEC 1.pptxSW SEC 1.pptx
SW SEC 1.pptx
 
RDBMS ER2 Relational
RDBMS ER2 RelationalRDBMS ER2 Relational
RDBMS ER2 Relational
 
27f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp0227f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp02
 
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptxdata base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
ECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptx
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]
 
ER model
ER modelER model
ER model
 
3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdf
 
Relationships and their representation in a class diagram.pptx
Relationships and their representation in a class diagram.pptxRelationships and their representation in a class diagram.pptx
Relationships and their representation in a class diagram.pptx
 
Relational algebra calculus
Relational algebra  calculusRelational algebra  calculus
Relational algebra calculus
 
classdiagram.pptx
classdiagram.pptxclassdiagram.pptx
classdiagram.pptx
 

Recently uploaded

一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
benishzehra469
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
NABLAS株式会社
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
Tiktokethiodaily
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
enxupq
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
vcaxypu
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
yhkoc
 
一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单
ewymefz
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
StarCompliance.io
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
ewymefz
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
Business update Q1 2024 Lar España Real Estate SOCIMI
Business update Q1 2024 Lar España Real Estate SOCIMIBusiness update Q1 2024 Lar España Real Estate SOCIMI
Business update Q1 2024 Lar España Real Estate SOCIMI
AlejandraGmez176757
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
theahmadsaood
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 

Recently uploaded (20)

一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
 
社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .社内勉強会資料_LLM Agents                              .
社内勉強会資料_LLM Agents                              .
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
 
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
一比一原版(CU毕业证)卡尔顿大学毕业证成绩单
 
一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
Business update Q1 2024 Lar España Real Estate SOCIMI
Business update Q1 2024 Lar España Real Estate SOCIMIBusiness update Q1 2024 Lar España Real Estate SOCIMI
Business update Q1 2024 Lar España Real Estate SOCIMI
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 

Mapping ER and EER Model

  • 1.
  • 2. The schema for database application displayed by graphical notation . It mainly comprises : • Entity and its attributes • Relationship, which is association among entities Ideas ER Design Relational Schema Relational DBMS Implementation
  • 3. Entity types represent collection of entities that have same attributes and are pictured by rectangular nodes. Basically the relation name. Weak – Entity Types
  • 4. A Relationship type R among entities types defines a set of associations. Relationship types associate entity types. They are pictured by Diamond nodes.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. • Create a new relation. • Include the simple attributes • Include the simple components of the composite attributes • Identify the primary keys. If the chosen key is composite, the set of simple attributes that form it will together form the primary key. • Don’t include: non-simple components of composite attributes, foreign keys, derived attributes.
  • 10.
  • 11. • Create a new relation. • Include simple attributes • Add the owner’s primary key attributes, as foreign key attributes • Declare into a primary key the partial keys of the weak entity type combined with those imported from the owner
  • 12.
  • 13. There are Three possible approaches: 1) Foreign key approach 2) Merged relation option 3) Cross-reference or relationship relation option
  • 14. 1) Foreign Key approach • Identify the relations S and T that correspond to the entity types participating in R. • Include as foreign keys, in the relation of one entity type, the primary keys of the other entity type • The entity having total participation must have the foreign key of the other entity. • Include also the simple attributes of the relationship type
  • 15. DEPARTMENT has total participation. Therefore, DEPARTMENT contains the foreign key, the primary key of EMPLOYEE. Example :
  • 16.
  • 17. 2) Merged relation option: • Merge the two entity types and the relationship into a single relation. • This may be appropriate when both participations are total.
  • 18. 3)Cross-reference or relationship relation option: • Create a third relation R for the purpose of cross-referencing the primary keys of the two relations S and T representing the entity types.
  • 19.
  • 20. • Add as foreign keys, to the relation of the entity type at the N side, the primary keys of the entity type at the 1 side (don’t duplicate records!) • Include also the simple attributes of the relationship type
  • 21.
  • 22. • Create a new relation. • Add as foreign keys the primary keys of the participating entity types to the relationship type(their combination will form the primary key) • Include the simple attributes of the relationship type
  • 23.
  • 24. • Create a new relation • Include the given attribute • Include as foreign keys the primary attributes of the entity/relationship type owning the multivalued attribute. • The primary key is combination of the attribute as well as the foreign key. • If the multivalued attribute is composite, we include its simple components.
  • 25. Example: • The relation DEPT_LOCATIONS is created. • The attribute DLOCATION represents the multivalued attribute. • LOCATIONS of DEPARTMENT, while DNUMBER-as foreign key-represents the primary key of the DEPARTMENT relation. • The primary key is the combination of {DNUMBER,DLOCATION}.
  • 26.
  • 27.  Includes all modeling concepts of basic ER  Additional concepts: subclasses/superclasses, specialization/generalization, categories, attribute inheritance  The resulting model is called the enhanced- ER or Extended ER (E2R or EER) model  It is used to model applications more completely and accurately if needed  It includes some object-oriented concepts, such as inheritance
  • 28. An entity type may have additional meaningful subgroupings of its entities Example: EMPLOYEE may be further grouped into SECRETARY, ENGINEER, MANAGER, TECHNICIAN, SALARIED_EMPLOYEE, HOURLY_EMPLOYEE  Each of these groupings is a subset of EMPLOYEE entities  Each is called a subclass of EMPLOYEE  EMPLOYEE is the superclass for each of these subclasses These are called superclass/subclass relationships.
  • 29. Example An entity that is member of a subclass represents the same real-world entity as some member of the superclass
  • 30.  An entity that is member of a subclass inherits all attributes of the entity as a member of the superclass  It also inherits all relationships
  • 31. • Is the process of defining a set of subclasses of a superclass • May have several specializations of the same superclass Example : {SECRETARY, ENGINEER, TECHNICIAN} is a specialization of EMPLOYEE based upon job type. Another specialization of EMPLOYEE based in method of pay is {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE • Attributes of a subclass are called specific attributes
  • 32. The subset symbol on each line connecting a subclass to the circle indicates direction of the superclass/subclass relationship. Example of Specialization
  • 33.  The reverse of the specialization process  Several classes with common features are generalized into a superclass; original classes become its subclasses Example: CAR, TRUCK generalized into VEHICLE; both CAR, TRUCK become subclasses of the superclass VEHICLE.  Both Specializations and Generalizations are shown in rectangles in EER diagrams (as are entity types)
  • 34. a) Predicate-defined - The subclass is defined through a predicate on the attributes of the superclass Defining predicate of the Sub class EMPLOYEE d Salaried employee Hourly_employee Salary > 30000Hours<6
  • 35. b) Attribute-defined - The subclasses in the specialization are all defined by the same attribute of the superclass c) User-defined – Membership determined during insertion Defining attribute of the Super class
  • 36. Disjoint (d) The subclasses must have disjoint sets of entities Overlap (o) The subclasses may have overlapping sets of entities Partial - An entity may not belong to any of the subclasses. Represented by Total - Every entity in the superclass must be a member of some subclass. Represented by Disjointness and completeness constraints are independent
  • 37. Note: Generalization usually is total because the superclass is derived from the subclasses
  • 38.  Every subclass participates as a subclass in only one class/subclass relationship  Single Inheritance  Results in a tree structure or strict hierarchy PURCHASED d WHOLESALERETAIL COOKIE HOME-MADE d
  • 39. Subclass can be a subclass in more than one class/subclass relationship  Multiple Inheritance  Also called Shared subclasses In a lattice or hierarchy, a subclass inherits attributes not only of its direct superclass, but also of all its predecessor superclasses
  • 40.  Subclass related to a collection of superclasses  Each instance of subclass belongs to one, not all of the superclasses  Superclasses form a union  Category can be total or partial  Subclass is called a category or UNION TYPE Note: The difference from shared subclass is that the member must exist in all of its superclasses).
  • 43. To Convert each Specialization and Generalized Superclass into a relational schema : a. Multiple relations-Superclass and subclasses b. Multiple relations-Subclass relations only c. Single relation with one type attribute d. Single relation with multiple type attributes NOTATION : Super class : C Primary Key : K Attributes : A(i) Sub class : S Relation : L
  • 44.
  • 45. a.Multiple relations-Superclass and subclasses  Create a relation L for C with attributes Attrs(L) = {K, A1, A2, …, An} and PK(L) = K.  Create a relation Li for each subclass Si, 1 < i < m, with the attributes ATTRS(Li) = {K} U {attributes of Si} and PK(Li) = K.  This option works for any constraints: disjoint or overlapping; total or partial.
  • 46.
  • 47. b. Multiple relations-Subclass relations only  Create a relation Li for each subclass Si, 1 < i < m, with ATTRS(Li) = {attributes of Si} U {K, A1, A 2, …, An } PK(Li) = K  This option works well only for disjoint and total constraints.  If the specialization is overlapping, the same entity may be duplicated in several relations.  If not total, entity not belonging to any sub-class is lost.
  • 49. c. Single relation with one type attribute  Create a single relation L with attributes Attrs(L) = {K, A1, …, A n} U {attributes of S1} U… U {attributes of S m} U {T} and PK(L)=K  This option is for specialization whose subclasses are DISJOINT, and T is a type/discriminating attribute that indicates the subclass to which each tuple belongs, if any. This option may generate a large number of null values.  Not recommended if many specific attributes are defined in subclasses (will result in many null values!)
  • 51. d. Single relation with multiple type attributes  Create a single relation schema L with attributes Attrs(L) = {K, A1, …, A n} U {attributes of S1} U… U {attributes of Sm} U {T1, …, T n} and PK(L)=K  This option is for specialization whose subclasses are overlapping, and each Ti, 1 < i < m, is a Boolean attribute indicating whether a tuple belongs to subclass Si.
  • 52. o
  • 53. Approach Pre-conditions Considerations Trade-off A(Super and Sub relations) None Most flexible but incurs a join cost B(Sub relations) Specialization must be total Specialization must be disjoint In order to query all entities of the supertype one must OUTER UNION the subtype relations (and project to Attr(C), technically) C (One relation, one type) Specialization must be disjoint If one table is desirable Potential for a large NULL cost D (One relation, Multiple type) None One table is desired but specialization is overlapping Also very flexible but incurs a NULL cost
  • 54.  All the Superclasses and the subclass must have the same primary key. Otherwise model as a Category  Apply any of the options discussed in Generalization/Specialization mapping(former topic)
  • 55.  For mapping a category whose defining superclass have different keys, it is customary to specify a new key attribute, called a surrogate key, when creating a relation to correspond to the category.  Let C₁,C₂,…,Cm be the entity types participating in the union and S be the union type. Create a relation for S and surrogate key ks so that PK(S)=ks, and also add ks to each Attr(Ci) as a foreign key into S. If all the Cis have the same primary key type, use that as PK(S) instead.
  • 56.
  • 57.
  • 58. Websites : • http://web.cse.ohiostate.edu/~gurari/course/cs e670/ • http://home.iitj.ac.in/~ramana/ch7- mappingER-EER-relations.pdf • http://jcsites.juniata.edu/faculty/rhodes/dbms/ eermodel.htm • http://www.cs.montana.edu/~halla/csci440/n9 /n9.html