SlideShare une entreprise Scribd logo
1  sur  59
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMS
koolkampus
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
shekhar1991
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
koolkampus
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship model
Jafar Nesargi
 

Tendances (20)

3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMS
 
Normal forms
Normal formsNormal forms
Normal forms
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
 
Elmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 pptElmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 ppt
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 
Normalization in a Database
Normalization in a DatabaseNormalization in a Database
Normalization in a Database
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
Mysql joins
Mysql joinsMysql joins
Mysql joins
 
Relational Algebra
Relational AlgebraRelational Algebra
Relational Algebra
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Relational Algebra & Calculus
Relational Algebra & CalculusRelational Algebra & Calculus
Relational Algebra & Calculus
 
Dbms normalization
Dbms normalizationDbms normalization
Dbms normalization
 
Advanced sql
Advanced sqlAdvanced sql
Advanced sql
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship model
 
DBMS PPT
DBMS PPTDBMS PPT
DBMS PPT
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Functional dependancy
Functional dependancyFunctional dependancy
Functional dependancy
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 

En vedette

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
 
ER model to Relational model mapping
ER model to Relational model mappingER model to Relational model mapping
ER model to Relational model mapping
Shubham Saini
 
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 diagram
Tech_MX
 
Enhanced E-R diagram
Enhanced E-R diagramEnhanced E-R diagram
Enhanced E-R diagram
Mayank Jain
 
D I T211 Chapter 3
D I T211    Chapter 3D I T211    Chapter 3
D I T211 Chapter 3
askme
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database design
Elias 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 examples
Rahul Khanwani
 

En vedette (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
 
ER model to Relational model mapping
ER model to Relational model mappingER model to Relational model mapping
ER model to Relational model 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
 

Similaire à Mapping ER and EER Model

27 f157al5enhanced er diagram
27 f157al5enhanced er diagram27 f157al5enhanced er diagram
27 f157al5enhanced er diagram
dddgh
 
RDBMS ER2 Relational
RDBMS ER2 RelationalRDBMS ER2 Relational
RDBMS ER2 Relational
Sarmad Ali
 
27f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp0227f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp02
marangburu42
 
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
 
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
 

Similaire à 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
 

Dernier

Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
amitlee9823
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
karishmasinghjnh
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
amitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Dernier (20)

Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
👉 Amritsar Call Girl 👉📞 6367187148 👉📞 Just📲 Call Ruhi Call Girl Phone No Amri...
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 

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