Chapter 21
21.2 Modes of Information Integration
Exercise 21.2.1
a) INSERT INTO Computers(number, speed, memory, hd)
Exercise 21.2.2
Global Schema:
Exercise 21.2.3
INSERT INTO Computers_g
SELECT number, proc, speed, memory, hd from Computers
Exercise 21.2.4
SELECT MAX(hd) from Computer where speed=3
Exercise 21.2.5
PC (model_number, process_id, mem_id, hd_id)
Processor (pid, name, speed)
Exercise 21.2.6
INSERT INTO AutosWhse(serialNo, model, color, autoTrans, dealer)
Exercise 21.2.7
INSERT INTO AutosWhse(serialNo, model, color, autoTrans, dealer)
(SELECT Autos.serial, model, color, ‘yes’, ‘dealer2’, FROM Autos
Exercise 21.2.8
a) SELECT serialNo FROM Cars WHERE autoTrans = ‘yes’
SELECT serial FROM Autos WHERE EXISTS(SELECT * FROM Options where serial =
Exercise 21.2.9
Global Schema = Books( ISBN10, ISBN13, name, authors, edition, year, pages, hi_price,
21.3 Wrappers In Mediator-Based Systems
Exercise 21.3.1
Exercise 21.3.2
a)
SELECT ‘B’, processor, mem, disk, screenSize FROM Systems WHERE processor = ‘$sp
SELECT ‘A’, speed, memory, hd, screen FROM Computers, Monitors WHERE speed = ‘$sp
Exercise 21.3.3
a) SELECT manf, mem, screen FROM PCMed WHERE speed = 3.1 AND disk = 120
21.4 Capability-Based Optimization
Exercise 21.4.1
a) uc[P-IV, G5, Athlon]bo[integer]u
Exercise 21.4.2
21.5 Optimizing Mediator Queries
Exercise 21.5.1
a) Yes,
Rfff [abc] -> Sbf [abcd] -> Tbff [abcde] -> Tfbf [abcde]
b) No.
c) Yes,
Tfff [bde] -> Sfb [bcde] -> Rfbf [abcde] -> Sbf [abcde]
Exercise 21.5.2
Exercise 21.5.3
Rff, Rfb, Rfu, Rfc, Rfo, Rbf, Rbb, Rbu, Rbc, Rco, Rcf, Rcb, Rcu, Rcc, Rco
Exercise 21.5.4
21.6 Local-as-View Mediators
Exercise 21.6.1
Q3 contains Q1
Exercise 21.6.2
V1(x,a) and V2(x,b) and V1(a,b) and V2(a,c) and V1(b,c) and V2(b,y)
Exercise 21.6.3
Exercise 21.6.4
21.7 Entity Resolution
Exercise 21.7.1
a)
All subsequences of “abcab”: “”, “a”, “b”, c”, “ab”, “ac”, “aa”, “bc”, ”ba”, “bb”, “abc”, “aba”,
c) 2n
Exercise 21.7.2
Strings
Longest Common Subsequences
Exercise 21.7.3
a)
Strings
Shortest Common Supersequences
“she”, “hers”
“shers”
“she”, “theirs”
stheirs”, “tsheirs”
“hers”, “they”
thersy”, “theyrs”, “therys”
“hers”, “theirs”
theirs”
“they”, “theirs”
“theyirs”, “theiyrs”, “theirys”, “theirsy”
b)
Shortest common supersequences of “abc” and “cb”:
abcb, acbc”, “cabc
“she”, “they”
“he”
“she”, “theirs”
“he”
“hers”, “they”
“he”
“hers”, “theirs”
“hers”
“they”, “theirs”
“the”
Exercise 21.7.4
a)
Idempotence
Yes, the merge will satisfy the idempotent law; the longest common subsequence of any string is
itself.
b)
Idempotence
Yes, the merge will satisfy the idempotent law; the shortest common supersequence of any string
is itself.
Exercise 21.7.5
Idempotence
i. A record is always similar to itself since all fields are identical.
ii.A record merging with itself is itself since all fields have common values
Commutativity
Associativity
(a Λ b) Λ c = a Λ (b Λ c)
(b Λ a) Λ c = b Λ (a Λ c) (commutative)
Name
Address
a
Susan
123 Oak St.
b
Susan
123 Oak St.
c
Susan
123 Oak St.
Susan
123 Oak St.
b Λ c
Susan
123 Oak St.
Applying the commutative law shows that between a, b, and c, there can be at most one field
where values may differ. Thus, the order of the merge does not matter since the result can only
differ with the remaining record by at most 1 field.
Representability
r ≈ s, r ≈ (s Λ t)
Name
Address
a
Susan
123 Oak St.
b
Susan
123 Oak Street
c
Susan
NULL.
d
Susan
123 Oak Street.
b Λ d
Susan
123 Oak Street.
Exercise 21.7.6
a b iff a Λ b = b
A partial order is reflexive, transitive, and antisymmetric.
Reflexive: a a
Thus, a ≤ c
Antisymmetric: a b and b a iff a = b