Professional Documents
Culture Documents
Generalisation
– inverse of specialisation
– realise two entity types have lots of common features
– suppress differences between entity types, identify the common
features and generalise them into a superclass
e.g. generalise CAR and TRUCK into the VEHICLE superclass
EER Diagrams
Code NIN
Sex TownBirth
Surname
Age TRAINEE
Level Area
U
U
Position Title
EMPLOYEE PROFESSIONAL
Constraints on Subclasses
can sometimes determine exactly the entities that will become members
of each subclasses
e.g. for EMPLOYEE subclass we may specify the condition of
membership to be predicate JobType=“Employee”
such condition act as constraints on the members of the EMPLOYEE
subclass
then we might have a class of “Young” trainees, whose age is less than 30
(no matter the job)
Code NIN
Sex TownBirth
Surname
JobType
Age TRAINEE
Level Area
JobType = JobType =
U
U
"Employee" "Professional"
Position Title
EMPLOYEE U PROFESSIONAL
Age < 30
YOUNG
if all subclasses in a specialisation have the membership condition on the
same attribute of the superclass we have attribute-defined subclasses
attribute is the defining attribute of the specialisation
shown by placing the name of the attribute on the arc from circle to
superclass
Code NIN
Sex TownBirth
Surname
JobType
Age TRAINEE
JobType
Level Area
U
U
"Employee" "Professional"
Position Title
EMPLOYEE PROFESSIONAL
where there is no condition we have a user-defined subclass
– membership is determined by database users when adding an entity to
the subclass
– e.g. the original TRAINEE definition without JobType attribute
Code NIN
Sex TownBirth
Surname
Age TRAINEE
Level Area
U
Position Title
EMPLOYEE PROFESSIONAL
we can have several specialisations of the same entity type using different
distinguishing characteristics
e.g. EMPLOYEE can be specialised on the basis of Position into SALARIED-EMPLOYEE,
HOURLY-PAID-EMPLOYEE
Code NIN
Sex TownBirth
Surname
JobType
Age TRAINEE
JobType
Level Area
U
U
"Employee" "Professional"
Position Title
EMPLOYEE PROFESSIONAL
Position
Salary
PayScale
U
U
"Salaried" "Hourly"
SALARIED HOURLY-PAID
Note that SALARIED and HOURLY-PAID are both EMPLOYEE and TRAINEE
Disjointness Constraint
specifies that subclasses of a specialisation are disjoint
– an entity can be a member of at most one of the subclasses of the specialisation
– attribute defined specialisation implies disjoint subclasses if the defining attribute is
single-valued
Surname
JobType
Age TRAINEE
JobType
Level o
Area
"Part−time"OR "Part−time"OR
U
U
"Employee" "Professional"
Position Title
EMPLOYEE PROFESSIONAL
Position
d
Salary
PayScale
U
U
"Salaried" "Hourly"
SALARIED HOURLY−PAID
2. Partial Specialisation
allows an entity not to belong to any of the subclasses
e.g. can have TRAINEES who are neither EMPLOYERS nor PROFESSIONALS
Completeness Constraints
Code NIN
Sex TownBirth
Surname
JobType
Age TRAINEE
JobType
Level o
Area
U
U
"Employee" "Professional"
Position Title
EMPLOYEE PROFESSIONAL
Position
d
Salary
PayScale
U
U
"Salaried" "Hourly"
SALARIED HOURLY-PAID
Insertion and Deletion Rules
1. deleting an entity from a superclass implies that it is automatically
deleted from all of the subclasses it belongs to
2. inserting an entity in a superclass implies that the entity is inserted in
all predicate-defined subclasses for which the entity satisfies the
defining predicate
3. inserting an entity in a superclass of total specialisation implies that
the entity is inserted in at least one of the subclasses of the
specialisation
4. inserting an entity in a superclass of disjoint, total specialisation
implies that the entity is inserted in one and only one of the subclasses
of the specialisation
special care for multiple hierarchies and lattices:
View Integration ER Schema Design
requirements are given for many user groups or applications
independently
an ER schema (view) is designed for each user group and application
(typically by different developers)
individual views are merged into the global conceptual schema
individual views can be reconstructed as external schemas after view
integration
can be difficult!
– need to specify correspondences among entity types, relationship
types and attributes before starting integration
– require good methodology and software support
– need to integrate conflicting views and verify the consistency of
inter-schema correspondences
View Integration: Tasks
3. merging of views
global schema is created by merging individual schemas
4. restructuring
global schema may require further refinement to remove redundancies
or unnecessary complexity
Conflicts Among Schemas
Code NIN
Sex TownBirth
Surname
JobType
Age TRAINEE
JobType
Level Area
U
U
"Employee" "Professional"
Position Title
EMPLOYEE PROFESSIONAL
Conflicts Among Schemas
2. type conflicts: the same concept may be represented in two schemas using
different modelling concepts
e.g. a department may be represented as an attribute in one schema
and an entity in another
e.g. a match can be represented as a relation in a schema or an entity
in another
Conflicts Among Schemas
2. type conflicts: the same concept may be represented in two schemas using
different modelling concepts
Date Time
Class
Code
NIN N N EDITION
ATTENDS
Surname
1
Age TRAINEE HELD IN
Code
Sex 1
TownBirth COURSE TYPE
Name
Code INSTRUCTOR
CourseType
Name
TownBirth Position
Surname
Conflicts Among Schemas
3. value set conflict: values of attributes may be represented differently
e.g. an ID code may be represented as a number in a schema and as text in another
may teach different courses, and another that an instructor must teach only one course at
a time
Modifying Views
Date Time
Class
Date Time Telephone Number
Code
Class
N N EDITION
ATTENDS Code
name
N N
1 VIEW 1 EDITION TEACHES Age VIEW 2
e PARTICIPANT HELD IN
Code CourseType
Code EMPLOYEE
1
Level
Position COURSE TYPE Name
Name
TownBirth Surname Position
Code NIN
Sex TownBirth
Surname
JobType
Age TRAINEE
JobType
VIEW 3
Level Area
U
U
"Employee" "Professional"
Position Title
EMPLOYEE PROFESSIONAL
Modifying Views
Date Time
Date Time
Class
Class Telephone Number
Code
N N EDITION Code
ATTENDS
name N
EDITION N
1 VIEW 1 TEACHES Age VIEW 2
e EMPLOYEE 1
HELD IN
Code HELD IN INSTRUCTOR
1 Code Name
Position Level COURSE TYPE 1
Name
COURSE TYPE TownBirth Surname Position
Code NIN
Sex TownBirth
Surname
JobType
Age TRAINEE
VIEW 3
JobType
Level Area
U
U
"Employee" "Professional"
Position Title
EMPLOYEE PROFESSIONAL
Merge Views & Eliminate Redundancies
Date Time Telephone Number
Class
Code
N N N N
ATTENDS EDITION TEACHES Age
1
HELD IN INSTRUCTOR
Code
1
COURSE TYPE TownBirth Surname Position
Name
Code NIN
Sex TownBirth
Surname
JobType
Age TRAINEE
JobType
Level Area
U
U
"Employee" "Professional"
Position Title
EMPLOYEE PROFESSIONAL
Another Example
Vol Num
Title
N N
PUBLISHED IN JOURNAL
Size
ARTICLE VIEW 1
N RESEARCHER
AUTHORED_BY
Name ClassificationID
Title
N N
BELONGS TO SUBJECT
Publisher
VIEW 2
BOOK
N
N AUTHOR
WRITTEN_BY
Modifying Views
Title
N PUBLISHED IN N JOURNAL
Size
VIEW 1
ARTICLE N N
BELONGS TO SUBJECT
N
N Name ClassificationID
WRITTEN_BY AUTHOR
Name ClassificationID
Title
N N
BELONGS TO SUBJECT
Publisher
VIEW 2
BOOK
N
N AUTHOR
WRITTEN_BY
Merging Views
introduced a generalisation, PUBLICATION, including BOOKS and
ARTICLES
Name ClassificationID
Type N N
BELONGS TO SUBJECT
Title
N
PUBLICATION
Type
N AUTHOR
WRITTEN_BY
d
U
U
"Book" "Article"
Vol Num
BOOK ARTICLE
Size N N
Publisher PUBLISHED IN JOURNAL
Integration Strategies
several approaches, order is based on measure of schema similarity (e.g.
shared entity types)
3
2 V5
V4
1
V3
V1 V2 V3 V4 V5
V1 V2
BINARY N-ARY
2 3
1 1 2
V3 V4 V5
V1 V2 V1 V2 V3 V4 V5