You are on page 1of 2

HORIZONTAL FRAGMENTATION EXERCISES

Question 1

Consider the following relation:

Property-for-Rent(property-id, type, address, rent, owner-id)

If we assume that there are only two possible property Types: “Flat” and “House”,
determine the horizontal fragmentation of the relation. Check the correctness of the
fragmentation schema against the three correctness Principles.

Question 2

Given relation EMP, 2 simple predicates are


identified:

1. p1: TITLE < “Programmer”


2. p2: TITLE > “Programmer”

1) Perform a horizontal fragmentation of relation EMP with respect to {p1,p2}

2) Explain why the resulting fragmentation (EMP1, EMP2) does not fulfill the
correctness rules of fragmentation

3) Modify the predicates p1 & p2 so that they partition EMP obeying the correctness
rules of fragmentation.

To do this, perform a horizontal fragmentation of EMP based on the new


minterm predicates. Finally, show that the result has completeness,
reconstruction & disjointness properties.

Question 3

Consider an organization where employees work in different departments, located in


different locations. A distributed database has been set up to store all the data for the
organization. The following two relations are from the organization database:

EMP(EmpNo, EName, Job, Sal, Deptno)


DEPT(Deptno, DName, Location)

1
Assume the following queries will access data from relations EMP and DEPT:

SELECT EmpNo, EName SELECT EmpNo, EName, Job, Sal


FROM EMP FROM EMP
WHERE Sal > 10000 WHERE Job = ‘Agent’

SELECT E.EName, D.Job, D.DName


FROM EMP E, DEPT D
WHERE E.Deptno = D.Deptno
AND Location = ‘France’

EMP
EmpNo EName Job Sal Deptno
001 Mary Agent 10,000 1
002 John Agent 8,000 1
003 Smith Agent 11,000 2
004 Peter Supervisor 15,000 1
005 Jackson Supervisor 15,500 2

DEPT
Deptno DName Location
1 Sales France
2 Marketing UK

Assumptions:
• Sales and Marketing department employs only 2 types of employees: Sales or
Marketing Agent and Supervisor.
• Departments are located in only 2 countries: France and UK.

1) Identify simple predicates that will fragment both relations horizontally.

2) Perform primary horizontal fragmentation on these two relations.

(a) Identify the corresponding fragments.

(b) Explain whether the fragments obtained obey the correctness rules of
fragmentation.

3) Derive the horizontal fragments of relation EMP w.r.t DEPT.

You might also like