SlideShare a Scribd company logo
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Chapter 8
The Enhanced
Entity-
Relationship
(EER) Model
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
The Enhanced Entity-
Relationship (EER) Model
 Enhanced ER (EER) model
 Created to design more accurate database
schemas
• Reflect the data properties and constraints more
precisely
 More complex requirements than traditional
applications
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Subclasses, Superclasses, and
Inheritance
 EER model includes all modeling concepts
of the ER model
 In addition, EER includes:
 Subclasses and superclasses
 Specialization and generalization
 Category or union type
 Attribute and relationship inheritance
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Subclasses, Superclasses, and
Inheritance (cont’d.)
 Enhanced ER or EER diagrams
 Diagrammatic technique for displaying these
concepts in an EER schema
 Subtype or subclass of an entity type
 Subgroupings of entities that are meaningful
 Represented explicitly because of their
significance to the database application
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Subclasses, Superclasses, and
Inheritance (cont’d.)
 Terms for relationship between a
superclass and any one of its subclasses
 Superclass/subclass
 Supertype/subtype
 Class/subclass relationship
 Type inheritance
 Subclass entity inherits all attributes and
relationships of superclass
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 6
Subclasses and Superclasses
(1)
 An entity type may have additional meaningful
subgroupings of its entities
 Example: EMPLOYEE may be further grouped into:
• SECRETARY, ENGINEER, TECHNICIAN, …
• Based on the EMPLOYEE’s Job
• MANAGER
• EMPLOYEEs who are managers
• SALARIED_EMPLOYEE, HOURLY_EMPLOYEE
• Based on the EMPLOYEE’s method of pay
 EER diagrams extend ER diagrams to represent these
additional subgroupings, called subclasses or subtypes
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 8
Subclasses and Superclasses
(2)
 Each of these subgroupings 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:
 EMPLOYEE/SECRETARY
 EMPLOYEE/TECHNICIAN
 EMPLOYEE/MANAGER
 …
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 9
Subclasses and Superclasses
(3)
 These are also called IS-A relationships
 SECRETARY IS-A EMPLOYEE, TECHNICIAN IS-A
EMPLOYEE, ….
 Note: An entity that is member of a subclass represents
the same real-world entity as some member of the
superclass:
 The subclass member is the same entity in a distinct
specific role
 An entity cannot exist in the database merely by being a
member of a subclass; it must also be a member of the
superclass
 A member of the superclass can be optionally included as a
member of any number of its subclasses
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 10
Subclasses and Superclasses
(4)
 Examples:
 A salaried employee who is also an engineer belongs to the
two subclasses:
• ENGINEER, and
• SALARIED_EMPLOYEE
 A salaried employee who is also an engineering manager
belongs to the three subclasses:
• MANAGER,
• ENGINEER, and
• SALARIED_EMPLOYEE
 It is not necessary that every entity in a superclass be a
member of some subclass
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 11
Representing Specialization in EER
Diagrams
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 12
Attribute Inheritance in Superclass / Subclass
Relationships
 An entity that is member of a subclass inherits
 All attributes of the entity as a member of the
superclass
 All relationships of the entity as a member of the
superclass
 Example:
 In the previous slide, SECRETARY (as well as
TECHNICIAN and ENGINEER) inherit the attributes
Name, SSN, …, from EMPLOYEE
 Every SECRETARY entity will have values for the
inherited attributes
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 13
Specialization (1)
 Specialization is the process of defining a
set of subclasses of a superclass
 The set of subclasses is based upon some
distinguishing characteristics of the entities
in the superclass
 Example: {SECRETARY, ENGINEER,
TECHNICIAN} is a specialization of
EMPLOYEE based upon job type.
• May have several specializations of the same
superclass
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 14
Specialization (2)
 Example: Another specialization of EMPLOYEE based on
method of pay is {SALARIED_EMPLOYEE,
HOURLY_EMPLOYEE}.
 Superclass/subclass relationships and specialization can be
diagrammatically represented in EER diagrams
 Attributes of a subclass are called specific or local attributes.
• For example, the attribute TypingSpeed of SECRETARY
 The subclass can also participate in specific relationship
types.
• For example, a relationship BELONGS_TO of
HOURLY_EMPLOYEE
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Specialization and
Generalization
 Specialization
 Process of defining a set of subclasses of an
entity type
 Defined on the basis of some distinguishing
characteristic of the entities in the superclass
 Subclass can define:
 Specific attributes
 Specific relationship types
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Specialization and
Generalization (cont’d.)
 Certain attributes may apply to some but
not all entities of the superclass
 Some relationship types may be
participated in only by members of the
subclass
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Generalization
 Reverse process of abstraction
 Generalize into a single superclass
 Original entity types are special subclasses
 Generalization
 Process of defining a generalized entity type
from the given entity types
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Constraints and Characteristics
of Specialization and
Generalization Hierarchies
 Constraints that apply to a single
specialization or a single generalization
 Differences between specialization/
generalization lattices and hierarchies
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 20
Constraints on Specialization and
Generalization (1)
 If we can determine exactly those entities
that will become members of each subclass
by a condition, the subclasses are called
predicate-defined (or condition-defined)
subclasses
 Condition is a constraint that determines
subclass members
 Display a predicate-defined subclass by writing
the predicate condition next to the line
attaching the subclass to its superclass
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 21
Constraints on Specialization and
Generalization (2)
 If all subclasses in a specialization have membership
condition on same attribute of the superclass,
specialization is called an attribute-defined specialization
 Attribute is called the defining attribute of the specialization
 Example: JobType is the defining attribute of the
specialization {SECRETARY, TECHNICIAN, ENGINEER} of
EMPLOYEE
 If no condition determines membership, the subclass is
called user-defined
 Membership in a subclass is determined by the database
users by applying an operation to add an entity to the
subclass
 Membership in the subclass is specified individually for each
entity in the superclass by the user
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 22
Displaying an attribute-defined specialization
in EER diagrams
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 23
Constraints on Specialization and
Generalization (3)
 Two basic constraints can apply to a
specialization/generalization:
 Disjointness Constraint:
 Completeness Constraint:
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 24
Constraints on Specialization and
Generalization (4)
 Disjointness Constraint:
 Specifies that the subclasses of the
specialization must be disjoint:
• an entity can be a member of at most one of the
subclasses of the specialization
 Specified by d in EER diagram
 If not disjoint, specialization is overlapping:
• that is the same entity may be a member of more
than one subclass of the specialization
 Specified by o in EER diagram
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 25
Constraints on Specialization and
Generalization (5)
 Completeness Constraint:
 Total specifies that every entity in the
superclass must be a member of some
subclass in the specialization/generalization
 Shown in EER diagrams by a double line
 Partial allows an entity not to belong to any of
the subclasses
 Shown in EER diagrams by a single line
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 26
Constraints on Specialization and
Generalization (6)
 Hence, we have four types of
specialization/generalization:
 Disjoint, total
 Disjoint, partial
 Overlapping, total
 Overlapping, partial
 Note: Generalization usually is total
because the superclass is derived from the
subclasses.
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 27
Example of disjoint partial Specialization
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 28
Example of overlapping total Specialization
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 29
Specialization/Generalization Hierarchies,
Lattices & Shared Subclasses (1)
 A subclass may itself have further subclasses
specified on it
 forms a hierarchy or a lattice
 Hierarchy has a constraint that every subclass
has only one superclass (called single
inheritance); this is basically a tree structure
 In a lattice, a subclass can be subclass of more
than one superclass (called multiple
inheritance)
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 30
Shared Subclass “Engineering_Manager”
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 31
Specialization/Generalization Hierarchies,
Lattices & Shared Subclasses (2)
 In a lattice or hierarchy, a subclass inherits attributes not
only of its direct superclass, but also of all its predecessor
superclasses
 A subclass with more than one superclass is called a
shared subclass (multiple inheritance)
 Can have:
 specialization hierarchies or lattices, or
 generalization hierarchies or lattices,
 depending on how they were derived
 We just use specialization (to stand for the end result of
either specialization or generalization)
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 32
Specialization/Generalization Hierarchies,
Lattices & Shared Subclasses (3)
 In specialization, start with an entity type and then define
subclasses of the entity type by successive specialization
 called a top down conceptual refinement process
 In generalization, start with many entity types and
generalize those that have common properties
 Called a bottom up conceptual synthesis process
 In practice, a combination of both processes is usually
employed
Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Slide 4- 33
Specialization / Generalization Lattice
Example (UNIVERSITY)

More Related Content

Similar to EER-database.ppt

3_EERD.pdf
3_EERD.pdf3_EERD.pdf
3_EERD.pdf
LPhct2
 
Fundamentals of oops in .Net
Fundamentals of oops in .NetFundamentals of oops in .Net
Fundamentals of oops in .Net
Harman Bajwa
 
Data Modeling - Enhanced ER diagrams & Mapping.pdf
Data Modeling - Enhanced ER diagrams & Mapping.pdfData Modeling - Enhanced ER diagrams & Mapping.pdf
Data Modeling - Enhanced ER diagrams & Mapping.pdf
Christalin Nelson
 
Ch05
Ch05Ch05
Ch05
cs19club
 
ER Diagram
ER DiagramER Diagram
ER Diagram
Robby Firmansyah
 
27f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp0227f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp02
marangburu42
 
Enhanced E-R diagram
Enhanced E-R diagramEnhanced E-R diagram
Enhanced E-R diagramMayank Jain
 
Ch 4 E E R Biz Rules
Ch 4  E E R  Biz RulesCh 4  E E R  Biz Rules
Ch 4 E E R Biz Rulesguest8fdbdd
 
Lecture-03 Introduction to UML
Lecture-03 Introduction to UMLLecture-03 Introduction to UML
Lecture-03 Introduction to UML
artgreen
 
3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) modelKumar
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systemsTaher Barodawala
 
Introduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdfIntroduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdf
TARGARYEN001
 
Database Chapter 3
Database Chapter 3Database Chapter 3
Database Chapter 3
shahadat hossain
 
Class Diagram | OOP and Design Patterns by Oum Saokosal
Class Diagram | OOP and Design Patterns by Oum SaokosalClass Diagram | OOP and Design Patterns by Oum Saokosal
Class Diagram | OOP and Design Patterns by Oum Saokosal
OUM SAOKOSAL
 
Enhanced ER Models
Enhanced ER ModelsEnhanced ER Models
Enhanced ER Models
Megha Sharma
 
8815346
88153468815346
8815346
Van Chau
 
Software Testing and UML Lab
Software Testing and UML LabSoftware Testing and UML Lab
Software Testing and UML Lab
Harsh Kishore Mishra
 
Ch04
Ch04Ch04
Ch04
cs19club
 

Similar to EER-database.ppt (20)

3_EERD.pdf
3_EERD.pdf3_EERD.pdf
3_EERD.pdf
 
Fundamentals of oops in .Net
Fundamentals of oops in .NetFundamentals of oops in .Net
Fundamentals of oops in .Net
 
Data Modeling - Enhanced ER diagrams & Mapping.pdf
Data Modeling - Enhanced ER diagrams & Mapping.pdfData Modeling - Enhanced ER diagrams & Mapping.pdf
Data Modeling - Enhanced ER diagrams & Mapping.pdf
 
Ch05
Ch05Ch05
Ch05
 
ER Diagram
ER DiagramER Diagram
ER Diagram
 
27f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp0227f157al5enhanceder diagram-111005002740-phpapp02
27f157al5enhanceder diagram-111005002740-phpapp02
 
Enhanced E-R diagram
Enhanced E-R diagramEnhanced E-R diagram
Enhanced E-R diagram
 
Ch 4 E E R Biz Rules
Ch 4  E E R  Biz RulesCh 4  E E R  Biz Rules
Ch 4 E E R Biz Rules
 
Lecture-03 Introduction to UML
Lecture-03 Introduction to UMLLecture-03 Introduction to UML
Lecture-03 Introduction to UML
 
3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systems
 
Chapter03
Chapter03Chapter03
Chapter03
 
Introduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdfIntroduction to UML, a guide to learn.pdf
Introduction to UML, a guide to learn.pdf
 
Database Chapter 3
Database Chapter 3Database Chapter 3
Database Chapter 3
 
Class Diagram | OOP and Design Patterns by Oum Saokosal
Class Diagram | OOP and Design Patterns by Oum SaokosalClass Diagram | OOP and Design Patterns by Oum Saokosal
Class Diagram | OOP and Design Patterns by Oum Saokosal
 
Enhanced ER Models
Enhanced ER ModelsEnhanced ER Models
Enhanced ER Models
 
Mca 504 dotnet_unit4
Mca 504 dotnet_unit4Mca 504 dotnet_unit4
Mca 504 dotnet_unit4
 
8815346
88153468815346
8815346
 
Software Testing and UML Lab
Software Testing and UML LabSoftware Testing and UML Lab
Software Testing and UML Lab
 
Ch04
Ch04Ch04
Ch04
 

More from MhndHTaani

Assig. Three PHP final presentation.pptx
Assig. Three PHP final presentation.pptxAssig. Three PHP final presentation.pptx
Assig. Three PHP final presentation.pptx
MhndHTaani
 
computer-history-powerpoint revised 1-20-13.pptx
computer-history-powerpoint revised 1-20-13.pptxcomputer-history-powerpoint revised 1-20-13.pptx
computer-history-powerpoint revised 1-20-13.pptx
MhndHTaani
 
cryptography.pptx
cryptography.pptxcryptography.pptx
cryptography.pptx
MhndHTaani
 
IOT technology.pptx
IOT technology.pptxIOT technology.pptx
IOT technology.pptx
MhndHTaani
 
Chapter 2 - HTML5.pdf
Chapter 2 - HTML5.pdfChapter 2 - HTML5.pdf
Chapter 2 - HTML5.pdf
MhndHTaani
 
info-sys-security3.pptx
info-sys-security3.pptxinfo-sys-security3.pptx
info-sys-security3.pptx
MhndHTaani
 
info-sys-security.pptx
info-sys-security.pptxinfo-sys-security.pptx
info-sys-security.pptx
MhndHTaani
 
Dr_Kamal_ch01.pptx
Dr_Kamal_ch01.pptxDr_Kamal_ch01.pptx
Dr_Kamal_ch01.pptx
MhndHTaani
 

More from MhndHTaani (8)

Assig. Three PHP final presentation.pptx
Assig. Three PHP final presentation.pptxAssig. Three PHP final presentation.pptx
Assig. Three PHP final presentation.pptx
 
computer-history-powerpoint revised 1-20-13.pptx
computer-history-powerpoint revised 1-20-13.pptxcomputer-history-powerpoint revised 1-20-13.pptx
computer-history-powerpoint revised 1-20-13.pptx
 
cryptography.pptx
cryptography.pptxcryptography.pptx
cryptography.pptx
 
IOT technology.pptx
IOT technology.pptxIOT technology.pptx
IOT technology.pptx
 
Chapter 2 - HTML5.pdf
Chapter 2 - HTML5.pdfChapter 2 - HTML5.pdf
Chapter 2 - HTML5.pdf
 
info-sys-security3.pptx
info-sys-security3.pptxinfo-sys-security3.pptx
info-sys-security3.pptx
 
info-sys-security.pptx
info-sys-security.pptxinfo-sys-security.pptx
info-sys-security.pptx
 
Dr_Kamal_ch01.pptx
Dr_Kamal_ch01.pptxDr_Kamal_ch01.pptx
Dr_Kamal_ch01.pptx
 

Recently uploaded

哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
balafet
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
Roger Valdez
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
eddie19851
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
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
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
jerlynmaetalle
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
javier ramirez
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
mzpolocfi
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
mbawufebxi
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
slg6lamcq
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
vikram sood
 

Recently uploaded (20)

哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
Machine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptxMachine learning and optimization techniques for electrical drives.pptx
Machine learning and optimization techniques for electrical drives.pptx
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
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
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...The affect of service quality and online reviews on customer loyalty in the E...
The affect of service quality and online reviews on customer loyalty in the E...
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
一比一原版(Dalhousie毕业证书)达尔豪斯大学毕业证如何办理
 
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
一比一原版(Bradford毕业证书)布拉德福德大学毕业证如何办理
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide毕业证书)阿德莱德大学毕业证如何办理
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
 

EER-database.ppt

  • 1. Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 The Enhanced Entity- Relationship (EER) Model
  • 2. Copyright © 2011 Ramez Elmasri and Shamkant Navathe The Enhanced Entity- Relationship (EER) Model  Enhanced ER (EER) model  Created to design more accurate database schemas • Reflect the data properties and constraints more precisely  More complex requirements than traditional applications
  • 3. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Subclasses, Superclasses, and Inheritance  EER model includes all modeling concepts of the ER model  In addition, EER includes:  Subclasses and superclasses  Specialization and generalization  Category or union type  Attribute and relationship inheritance
  • 4. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Subclasses, Superclasses, and Inheritance (cont’d.)  Enhanced ER or EER diagrams  Diagrammatic technique for displaying these concepts in an EER schema  Subtype or subclass of an entity type  Subgroupings of entities that are meaningful  Represented explicitly because of their significance to the database application
  • 5. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Subclasses, Superclasses, and Inheritance (cont’d.)  Terms for relationship between a superclass and any one of its subclasses  Superclass/subclass  Supertype/subtype  Class/subclass relationship  Type inheritance  Subclass entity inherits all attributes and relationships of superclass
  • 6. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 6 Subclasses and Superclasses (1)  An entity type may have additional meaningful subgroupings of its entities  Example: EMPLOYEE may be further grouped into: • SECRETARY, ENGINEER, TECHNICIAN, … • Based on the EMPLOYEE’s Job • MANAGER • EMPLOYEEs who are managers • SALARIED_EMPLOYEE, HOURLY_EMPLOYEE • Based on the EMPLOYEE’s method of pay  EER diagrams extend ER diagrams to represent these additional subgroupings, called subclasses or subtypes
  • 7. Copyright © 2011 Ramez Elmasri and Shamkant Navathe
  • 8. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 8 Subclasses and Superclasses (2)  Each of these subgroupings 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:  EMPLOYEE/SECRETARY  EMPLOYEE/TECHNICIAN  EMPLOYEE/MANAGER  …
  • 9. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 9 Subclasses and Superclasses (3)  These are also called IS-A relationships  SECRETARY IS-A EMPLOYEE, TECHNICIAN IS-A EMPLOYEE, ….  Note: An entity that is member of a subclass represents the same real-world entity as some member of the superclass:  The subclass member is the same entity in a distinct specific role  An entity cannot exist in the database merely by being a member of a subclass; it must also be a member of the superclass  A member of the superclass can be optionally included as a member of any number of its subclasses
  • 10. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 10 Subclasses and Superclasses (4)  Examples:  A salaried employee who is also an engineer belongs to the two subclasses: • ENGINEER, and • SALARIED_EMPLOYEE  A salaried employee who is also an engineering manager belongs to the three subclasses: • MANAGER, • ENGINEER, and • SALARIED_EMPLOYEE  It is not necessary that every entity in a superclass be a member of some subclass
  • 11. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 11 Representing Specialization in EER Diagrams
  • 12. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 12 Attribute Inheritance in Superclass / Subclass Relationships  An entity that is member of a subclass inherits  All attributes of the entity as a member of the superclass  All relationships of the entity as a member of the superclass  Example:  In the previous slide, SECRETARY (as well as TECHNICIAN and ENGINEER) inherit the attributes Name, SSN, …, from EMPLOYEE  Every SECRETARY entity will have values for the inherited attributes
  • 13. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 13 Specialization (1)  Specialization is the process of defining a set of subclasses of a superclass  The set of subclasses is based upon some distinguishing characteristics of the entities in the superclass  Example: {SECRETARY, ENGINEER, TECHNICIAN} is a specialization of EMPLOYEE based upon job type. • May have several specializations of the same superclass
  • 14. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 14 Specialization (2)  Example: Another specialization of EMPLOYEE based on method of pay is {SALARIED_EMPLOYEE, HOURLY_EMPLOYEE}.  Superclass/subclass relationships and specialization can be diagrammatically represented in EER diagrams  Attributes of a subclass are called specific or local attributes. • For example, the attribute TypingSpeed of SECRETARY  The subclass can also participate in specific relationship types. • For example, a relationship BELONGS_TO of HOURLY_EMPLOYEE
  • 15. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Specialization and Generalization  Specialization  Process of defining a set of subclasses of an entity type  Defined on the basis of some distinguishing characteristic of the entities in the superclass  Subclass can define:  Specific attributes  Specific relationship types
  • 16. Copyright © 2011 Ramez Elmasri and Shamkant Navathe
  • 17. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Specialization and Generalization (cont’d.)  Certain attributes may apply to some but not all entities of the superclass  Some relationship types may be participated in only by members of the subclass
  • 18. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Generalization  Reverse process of abstraction  Generalize into a single superclass  Original entity types are special subclasses  Generalization  Process of defining a generalized entity type from the given entity types
  • 19. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Constraints and Characteristics of Specialization and Generalization Hierarchies  Constraints that apply to a single specialization or a single generalization  Differences between specialization/ generalization lattices and hierarchies
  • 20. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 20 Constraints on Specialization and Generalization (1)  If we can determine exactly those entities that will become members of each subclass by a condition, the subclasses are called predicate-defined (or condition-defined) subclasses  Condition is a constraint that determines subclass members  Display a predicate-defined subclass by writing the predicate condition next to the line attaching the subclass to its superclass
  • 21. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 21 Constraints on Specialization and Generalization (2)  If all subclasses in a specialization have membership condition on same attribute of the superclass, specialization is called an attribute-defined specialization  Attribute is called the defining attribute of the specialization  Example: JobType is the defining attribute of the specialization {SECRETARY, TECHNICIAN, ENGINEER} of EMPLOYEE  If no condition determines membership, the subclass is called user-defined  Membership in a subclass is determined by the database users by applying an operation to add an entity to the subclass  Membership in the subclass is specified individually for each entity in the superclass by the user
  • 22. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 22 Displaying an attribute-defined specialization in EER diagrams
  • 23. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 23 Constraints on Specialization and Generalization (3)  Two basic constraints can apply to a specialization/generalization:  Disjointness Constraint:  Completeness Constraint:
  • 24. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 24 Constraints on Specialization and Generalization (4)  Disjointness Constraint:  Specifies that the subclasses of the specialization must be disjoint: • an entity can be a member of at most one of the subclasses of the specialization  Specified by d in EER diagram  If not disjoint, specialization is overlapping: • that is the same entity may be a member of more than one subclass of the specialization  Specified by o in EER diagram
  • 25. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 25 Constraints on Specialization and Generalization (5)  Completeness Constraint:  Total specifies that every entity in the superclass must be a member of some subclass in the specialization/generalization  Shown in EER diagrams by a double line  Partial allows an entity not to belong to any of the subclasses  Shown in EER diagrams by a single line
  • 26. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 26 Constraints on Specialization and Generalization (6)  Hence, we have four types of specialization/generalization:  Disjoint, total  Disjoint, partial  Overlapping, total  Overlapping, partial  Note: Generalization usually is total because the superclass is derived from the subclasses.
  • 27. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 27 Example of disjoint partial Specialization
  • 28. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 28 Example of overlapping total Specialization
  • 29. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 29 Specialization/Generalization Hierarchies, Lattices & Shared Subclasses (1)  A subclass may itself have further subclasses specified on it  forms a hierarchy or a lattice  Hierarchy has a constraint that every subclass has only one superclass (called single inheritance); this is basically a tree structure  In a lattice, a subclass can be subclass of more than one superclass (called multiple inheritance)
  • 30. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 30 Shared Subclass “Engineering_Manager”
  • 31. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 31 Specialization/Generalization Hierarchies, Lattices & Shared Subclasses (2)  In a lattice or hierarchy, a subclass inherits attributes not only of its direct superclass, but also of all its predecessor superclasses  A subclass with more than one superclass is called a shared subclass (multiple inheritance)  Can have:  specialization hierarchies or lattices, or  generalization hierarchies or lattices,  depending on how they were derived  We just use specialization (to stand for the end result of either specialization or generalization)
  • 32. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 32 Specialization/Generalization Hierarchies, Lattices & Shared Subclasses (3)  In specialization, start with an entity type and then define subclasses of the entity type by successive specialization  called a top down conceptual refinement process  In generalization, start with many entity types and generalize those that have common properties  Called a bottom up conceptual synthesis process  In practice, a combination of both processes is usually employed
  • 33. Copyright © 2011 Ramez Elmasri and Shamkant Navathe Slide 4- 33 Specialization / Generalization Lattice Example (UNIVERSITY)