Step 3. Data Integration: Global Database
Step 3. Data Integration: Global Database
Global
database
Relational
Database 1
Relational
Database n Integrated
schema
110/07/27 3
Step 1 Resolve conflicts among EER model
Loan
Customer ====> Customer Customer
Borrower
name name name name
date date open-acct-date loan-begin-date
110/07/27 5
Resolve conflicts on data types
n 1
Ax Ca Cx == ==> Ca R Cx
1 1
Ax Ca .C x == ==> Ca R .C x
Ax n m
Ay .C a Cx == == > Ay Ca R Cx
110/07/27 6
Example
Schema A Schema B
Transformed schema A
A B A A'
n 1
customer
Loan name
==>
type Loan book
name
Customer Customer
type Contract Contract
110/07/27 7
Resolve conflicts on key
110/07/27 8
Example
name name
Customer
name
Customer customer#
===> Customer customer#
customer#
110/07/27 9
Resolve conflicts on cardinality
1 1 1 n 1 n
Entity x
R Entity y
Entity x
R Entity y ====> Entity x R Entity y
110/07/27 10
Example
110/07/27 11
Resolve conflicts on weak entity
Schema A Schema B Transformed schema A'
A1 B1 A1
A2 n A2
n
A2 n
Entityy Attrb Attra Attra
Entityyy Attrb Entityyy
Attrb
110/07/27 12
Example
110/07/27 13
Resolve conflicts on subtype entity
Schema A
A1 Schema B Schema X
1 A2 B1 B2 X1 X2
1 1
Entityx R Entityy Entityx R Entityy Entityx R Entityy
110/07/27 14
Example
110/07/27 15
Step 2 Merge entities
110/07/27 16
Example
customer#
A B x customer#
address customer# address
phone Customer Customer age ==> Customer phone
age
110/07/27 17
Merge EER models by Generalization
Schema A Schema B Schema X
X
A B Attrk
Entityz
Entityx Attrk Entityy Attrk
======>
User d=disjoint
supervision d
X1 X2
name x
Local Overseas Customer
Customer Customer ======>
x1 x2
Commerical mortgage_rate
Mortgage
prime_rate
loan_amt
Loan Loan
Borrower
Figure 8 Merge EER models by genealisation loan_amt Borrower
110/07/27 19
Merge EER models by Subtype
Relationship
110/07/27 20
Example
S chem a B S chem a X
S chem a A
B X1 X2
A
In te re s t F ix e d In te re s t K K F ix e d
K
R a te R a te K ====> R a te is a R a te
110/07/27 21
Merge entities by Aggregation
Schema A Schema B
Schema X
A B
X1
1 n
1 n
Entityx Entityy R Entityz ==> Entityy R1 Entityz
R2
Entityx X2
110/07/27 22
Example
Schema X
Schema A Schema B
A B2 X1
B1 B
1 n 1 n
Loan Loan Loan
Customer book Customer book
Security Contract ==> Contract
1
secured
by
n
Loan
X2
Security
110/07/27 23
Merge entities by categorization
Schema A Schema B
Schema X
X1
B Xc2
A1 A2 Xc1
Entity Z X2
110/07/27 24
Example
Schema X
Schema A Schema B
X1
A1 A2 B
Xc1 Xc2
Mortgage Commercial Loan Mortgage Commercial
loan loan Contract ==> loan loan
C=categorisation C
Loan
X2
Contract
110/07/27 25
Merge entities by Implied Binary
Relationship
X1 Schema X
Schema A Schema B Attr X X2
A B
n 1
Attr X Entity Entity Attr X
====> Entity a R Entity
a b b
Schema X
Schema A Schema B X1 Attr Attr
A B Y X X2
Attr 1 1
X Attr Entity
Entity Entity Attr
Y ====> Entity a
R b
Attr Y
a b X
110/07/27 26
Example
Schema A Schema B Schema X
X2
A B X1
Loan Loan n 1
Customer ==> book Customer
Contract Contract
loan#
customer# customer# loan# customer#
Loan Loan 1 1
Customer ==> book Customer
Contract Contract
loan# loan#
customer# customer# loan# customer#
110/07/27 27
Step 3 Merge relationships
Merge relationships by subtype relationship
Schema A Schema B
Schema X
A1 A A2 B1 B2 X1 X X3
1 1 1 1
EntityX R EntityY EntityX R EntityY EntityX R EntityZ
isa
X2 EntityY
110/07/27 28
Example
110/07/27 29
Merge relationships by overlap generalization
Schema A
Schema B
Schema X
A1 A A2 B1 B2
1 n 1 1 n X1
Entity X
R1 Entity Y Entity R2 Entity ===> Entity X
X Y
1 1
R1 R2
n n
X3 Entity X4 Entity
O
Z1 Z2
Entity Y
110/07/27 X2 30
Example
Schema A Schema B Schema X
A B X1
A1 A2 B1 B2
1 n 1 n Bank
Bank
home
Customer Bank
auto
Customer ===> 1
loan loan 1
home auto
loan loan
X3 n n X4
Home loan Auto loan
borrower borrower
o=overlap generalisation O
X2
Customer
110/07/27 31
Absorbing Lower degree
Relationship into a Higher degree
Relationship
Schema A
Schema B
Schema X
A1 A2 B1 B2
X1 X2
m : n 1 1 n
Entity X
Entity Y Entity R2 Entity ===> m : n
X Y Entity X Entity Y
m R1 m
m R1 m
: :
:
n :
n n
Entity n
Z
110/07/27 X3 Entity Z 32
Example
110/07/27 33
Case Study: In a bank, there are existing databases with different
schemas: one for the customers, another for the mortgage loan contracts
and a third for the index interest rate. However, there is a need to
integrate them together for an international banking loan system.
loan contract#
begin_date
Mortgage mature_date ID#
ID# Customer customer_name
loan contract loan-status date
1 1
1 1
1
1
1 1 (0,n) 1 n
n
Mortgage Loan Mortgage
Mortgage Loan Mortgage loan
loan
loan interest
interest loan
loan account
drawdown
drawdown type
type balance
balance history
loan contract# past loan# account#
loan contract# Loan_contract#
loan_bal_date past_loan_status
drawdown_date Interest_effective_date
drawdown_amt fixed_rate balance_amt
accurred_interest Mortgage
Mortgage
loan
loan
repayment
index Interest_effective_date
repayment
interest index_rate
loan contract# type accured interest
repayment_date
repayment
110/07/27 34
Step 2 Merge entities by Implied binary relationship and Generalization
Since data ID# appears in entity Mortgage Loan Contract and entity
Customer, they are in one-to-many cardinality with foreign key on the
“many” side. loan contract#
begin_date m ID#
Mortgage 1
mature_date book Customer customer_name
loan contract date
Since Fixed and Index Interest Rate both have the same key,
Interest_effective_date, they can be generalized disjointed as either
fixed or index rate.
Loan
interest
type
Interest_effective_date
Interest_type
d
fixed index
interest interest
rate type
Interest_effective_date
Interest_effective_date Index_rate
110/07/27 fixed_rate Index_name 35
accured_interest accured_interest
Thus, we can derive cardinality from the implied relationship between
these entities, and integrate the two schemas into one EER model.
loan contract#
begin_date m ID#
Mortgage 1
mature_date book Customer customer_name
loan contract date
1 1
1 1
1
1
fixed index
interest interest
rate type
Loan_contract# Loan_contract#
Interest_effective_date Interest_effective_date
fixed_rate Index_rate
accured_interest accured_interest
110/07/27 36
Reading assignment
“Information Systems Reengineering and
Integration” by Joseph Fong, published by
Springer Verlag, 2006, pp. 282-310.
110/07/27 37
Review question 3
Can two Relational Schemas be integrated into one
Relational Schema? Explain your answer.
110/07/27 38
Tutorial question 3
Provide an integrated schema for the following two views which are merged to create a bibliographic database. During
identification of correspondences between the two views, the users discover the followings:
RESEARCHER and AUTHOR are synonyms,
CONTRIBUTED_BY and WRITTEN_IN are synonyms,
ARTICLES belongs to a SUBJECT.
ARTICLES and BOOK can be generalized as PUBLICATION.
Hints: Given two subclass entities have same relationship(s). The two subclasses entities can be generalized into a
superclass entity and the subclass relationship(s) can also be generalized into a superclass relationship..
View 1
Title
n 1 Volume
ARTICLE Published_in JOURNAL
Size Number
Contributed_by
Full_Name RESEARCHER
View 2
Title
n 1 Classification_id
BOOK Belongs_to SUBJECT
Publisher Name
n
Written_in
m
110/07/27 39
Full_Name AUTHOR