Division Operations

Division Operation
The Division operation is useful for a particular type of query that occurs quite frequently
in database applications. Assume relation R is defined over the attribute set A and relation
S is defined over the attribute set B such that B ⊆ A (B is a subset of A). Let C = A − B, that
is, C is the set of attributes of R that are not attributes of S. We have the following definition
of the Division operation.
R ÷ S The Division operation defines a relation over the attributes C that consists of
the set of tuples from R that match the combination of every tuple in S.
We can express the Division operation in terms of the basic operations:
T1←ΠC(R)
T2←ΠC((T1 × S) − R)
T ← T1 − T2
Example 4.11 Division operation
Identify all clients who have viewed all properties with three rooms.
We can use the Selection operation to find all properties with three rooms followed by the
Projection operation to produce a relation containing only these property numbers. We can
then use the following Division operation to obtain the new relation shown in Figure 4.12.
(ƒ®clientNo, propertyNo(Viewing)) € (ƒ®propertyNo(ƒÐrooms = 3(PropertyForRent)))
Division Operations Division Operations Reviewed by Shopping Sale on 22:08 Rating: 5

No comments:

Powered by Blogger.