0% found this document useful (0 votes)
49 views35 pages

Lecture 03 Enhanced ERD

This document discusses enhanced entity-relationship (EER) modeling and inheritance in EER diagrams. It introduces inheritance relationships where one entity type is a subtype of another using "is-a" notation. Inheritance allows subtypes to inherit attributes and relationships from supertypes. The document describes disjoint and covering constraints on inheritance and notations for representing these constraints. It also discusses the differences between multiple inheritance and unions.

Uploaded by

Sharmainne Pale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views35 pages

Lecture 03 Enhanced ERD

This document discusses enhanced entity-relationship (EER) modeling and inheritance in EER diagrams. It introduces inheritance relationships where one entity type is a subtype of another using "is-a" notation. Inheritance allows subtypes to inherit attributes and relationships from supertypes. The document describes disjoint and covering constraints on inheritance and notations for representing these constraints. It also discusses the differences between multiple inheritance and unions.

Uploaded by

Sharmainne Pale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

IM 101

Fund. of Database Systems


ALDERSGATE COLLEGE
Lecture 3 – Sections 4.1-4.5
Enhanced Entity-Relationship Diagrams
ER Notation
REVIE
W
Enhanced ER Model (EER)

● aka Extended Entity-Relationship Model


● adds Inheritance
○ indicates that one entity type is
an extension of another entity type
○ often referred to as an IS-A relationship
Inheritance

http://www.agilemodeling.com/artifacts/classDiagram.htm
Inheritance: UML
● Inheritance defines a subclass relationship
○ A subclass inherits all properties (members) of the superclass
● This is the perspective
of most modern programming languages
Set Theoretic View of Inheritance
● B ⊂ A, C ⊂ A everything true about a member
● Every B is also an A
● Every C is also an A of a set is also true about any
member of its subsets.

all entities

A
B C
EER IsA Notation

Phone
Name PERSON
ID

IsA

STUDENT PROFESSOR

Major Class Dept Office

(not used in our textbook)


EER Subset Notation

Phone
Name PERSON
ID

STUDENT PROFESSOR

Major Class Dept Office

preferred notation: shows directionality of inheritance


EER Subset Notation (variant)

Phone
Name PERSON
ID

STUDENT PROFESSOR

Major Class Dept Office

The circle may be omitted when not needed.


Inheritance of Properties
● Student and professor entities have all
attributes defined for a person,
plus additional attributes
● Keys are also inherited.
Subtypes should not define new keys.

Phone
Name PERSON
ID

STUDENT PROFESSOR

Major Class Dept Office


Inheritance of Relationships

● Relationships are also inherited by subtypes

Every mouse
must be sold with
a computer? TRUE

Every computer
must be sold with
a mouse? FALSE
Constraints on Inheritance

● Disjointness: an entity can be


a member of at most one subtype

○ a person may be a student or may be a professor, but not both

● Covering: every entity of the supertype


must also be a member of at least one subtype

○ every person must be a professor or a student


Disjoint Subsets
● B ⊂ A, C ⊂ A no entity is in both B and C
● B∩C=∅

all entities

A
B C
Overlapping Subsets
● B ⊂ A, C ⊂ A an entity may be in both B and C
● B∩C=∅
overlapping = non-disjoint

all entities

A
B C
Covering Subsets
● B ⊂ A, C ⊂ A every entity in A is also in B or C
● B∪C=A

all entities
A

B C
Non-Covering Subsets
● B ⊂ A, C ⊂ A some entities in A are not in B or C
● B∪C=A

all entities

A
B C
Inheritance Constraint Notation

● IsA (triangle) notation:

write “disjoint” and/or “covering”


next to the triangle

● Subset notation,

‘d’ in the circle 🡪 disjointness


‘o’ in the circle 🡪 no disjointness (overlap)

required participation from supertype


indicates a covering constraint
Non-disjoint, Non-covering
● Every A can also be a B or a C, or both, or neither

A A

IsA o

B C B C
Disjoint, Non-covering
● Every A can also be a B or a C or but not both

A A

disjoint
IsA d

B C B C
Non-disjoint, Covering
● Every A must be a B or a C or both

A A

covering
IsA o

B C B C
Disjoint, Covering
● Every A must be a B or a C, but not both

A A

disjoint,
IsA d
covering

B C B C
disjoint, covering inheritance:
every car is a vehicle
every truck is a vehicle
every vehicle is either a car or a truck
no vehicle is both a car and a truck
disjoint, non-covering inheritance:
employees may be secretaries, technicians or
engineers, but not more than one of these
non-disjoint, covering inheritance:
every part is a manufactured part,
or a purchased part,
or both (a purchased, manufactured part)

** How many attributes does a purchased, manufactured part have?


** How would we model this in UML (C++ or Java)?
** Interpret this schema.

** Can you find a real-world example?


Inheritance Lattice

Multiple inheritance gives us a lattice,


rather than a hierarchy

** Could we have engineering managers without defining the E_M class?


(compare to previous example)
Unions
● Union defines a type as the union of other types
● OWNER = PERSON ∪ COMPANY
● OWNER is called a union type or category
○ OWNER is the subtype of the union of PERSON and COMPANY
● Not multiple inheritance
○ an OWNER does not need all the
attributes from
both PERSON and COMPANY
PERSON COMPANY

OWNER
Comparison

B and C are subtypes of A A is a subtype of B∪C


B⊂A
B⊂A A ⊂ B∪C
B∪C ⊂ A

A A

d ∪

B C B C

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy