What do you understand by union compatibility of relations? For which operations such compatibility is required and why?

The union compatibility of relations implies that the participating relations must fulfil the following conditions.

  1. Same degree, i.e. The two relations must have the same number (set) of attributes.

  2. Same domain of each corresponding pair of attributes of relation A and relation B, that is

Dom(A) = Dom (B)

That is, the domain (stands for data type) for the corresponding attributes must be identical.

Hence, we can say any two relations say, relation A and relation B are union compatible, iff (if and only if), both the relations have the same number of attributes and the domains of their corresponding attributes are the identical (column by column).

The following are the various operations for which union compatibility of relations is required.

  1. Union (A ∪ B)- It  contains all tuples from each of the relations.

  2. Intersection (A ∩ B)- It contains all the tuples that are contained in both the relations A and B.

  3. Difference (A – B)- It contains all the tuples that are contained in the relation A but are not present in the relation B.

  4. Cartesian Product (A × B)- It contains the set of all concatenated tuples (x, y), where x is a tuple in the relation A and y is the a tuple in the relation B. The tuples in the Cartesian product contains the product of each tuple of the relation A and each tuple of the relation B. (It must be noted that for performing Cartesian product it is not necessary that the two relations must be union compatible).

In order to run these operations, it is important that the two relations must be union compatible. It is because of the fact that the relations without being union compatible that is not of same degree of attributes and having same domain, may lead to difficulty in performing such operations.

  • 0
What are you looking for?