Tutorial 02 2023
Tutorial 02 2023
26 April 2023
Fragment schema:
STU1 at sites 1, 5
STU2 at sites 2, 6
STU3 at sites 3, 7 and
STU4 at sites 4, 8
(a) Write an application that requires the student ID (regno) from the terminal and outputs
the name, course name, DOB, and year-of-admission at levels fragment, location, and
local mapping transparency.
(b) Write an application that moves the student No 102 from the course MBA to the
course PGDBM at dierent levels of data distribution transparency
2. A country-wide drug supplier chain operates from ve dierent cities in the country and
maintains the following database:
(a) List the manufacturers' names who belong to the same city in which the drug shop that
has placed an order resides.
(b) How many orders are generated from a city, say C?
1
3. Comment on the following statement:
(a) Semijoin can be used to reduce the cost of a join operation in a distributed environment.
(b) Join operation should be done after selection, projection and union operations for
distributed database systems.
4. Assume that relation PROJ of the sample database is horizontally fragmented as follows:
Transform the following query into a reduced query on fragments:
FROM PROJ NATURAL JOIN ASG
WHERE PNO = "P4"
5. Assume that relation PROJ is horizontally fragmented as in Problem 3 above, and that
relation ASG is horizontally fragmented as:
is better than the fragment query:
size(EMP) = 100
size(ASG) = 200
size(PROJ) = 300
size(EMP ASG) = 300
2
8. Consider the following relations:
Write down suitable queries in SQL-like syntax and in relational algebra for nding the names
of employees who are managers of any project. Is the query optimized? If not optimize it.
9. Consider the following schemas:
10. Consider the following query on our engineering database:
SELECT ENAME,SAL
FROM PAY NATURAL JOIN EMP NATURAL JOIN ASG
NATURAL JOIN PROJ
WHERE (BUDGET>200000 OR DUR>24)
Assume that relations EMP, ASG, PROJ, and PAY have been stored at sites 1, 2, and 3
according to the table below. Assume also that the transfer rate between any two sites is
equal and that data transfer is 100 times slower than data processing performed by any site.
Finally, assume that size(R./S) = max (size(R), size(S)) for any two relations R and , and
the selectivity factor of the disjunctive selection of the query is 0.5. Compose a distributed
program that computes the answer to the query and minimizes total time.
It is the work of true education to train the youth to be thinkers, and not mere reectors of other men's thought -
Education, p17.