
202
■
Distributed Database Systems
Using detachment technique, the above query can be replaced by the following queries, q1 and q2,
where Course1 is an intermediate relation.
q1: Select Course.course-id into Course1 from Course where duration ⴝ 4.
q2: Select sname, name from Student, Course1, Teacher where Student.course-id ⴝ Course1.
course-id and Course1.course-id ⴝ Teacher.course-id.
Similarly, the successive detachment of q2 may generate the queries q21 and q22 as follows.
q21: Select name, Teacher.course-id into Teacher1 from Teacher, Course1 where Teacher.
course-id ⴝ Course1.course-id.
q22: Select sname from Student, Teacher1 where Student.course-id ...