logo

Set Operators

Data Models

Union (∪) Operator

Suppose R and S are two relations. The Union operation selects all the tuples that are either in relation R, in relation S, or in both relations R and S. It eliminates duplicate tuples.

For a union operation to be valid, the following conditions must hold:

1. Both relations R and S have the same number of attributes.

2. Corresponding attributes (columns) have the same domain (type).

3. The attributes of R and S must occur in the same order.

4. Duplicate tuples are automatically removed.

Symbol:

Notation: R ∪ S

Relational Algebra: R ∪ S

Data Models Data Models Data Models

Intersection (∩) Operator

Suppose R and S are two relations. The Set Intersection operation selects all the tuples that are in both relations R and S.

For a Set Intersection to be valid, the following conditions must hold:

1. Both relations R and S have the same number of attributes.

2. Corresponding attributes (columns) have the same domain (type).

3. The attributes of R and S must occur in the same order.

Symbol:

Syntax: R ∩ S

Relational Algebra: R ∩ S

This version ensures the conditions for compatibility are clear and corrects any grammatical or conceptual errors.

Data Models Data Models Data Models

Difference ( - ) Operator

Suppose R and S are two relations. The Set Difference operation selects all the tuples that are present in the first relation R but not in the second relation S.

For a Set Difference to be valid, the following conditions must hold:

1. Both relations R and S have the same number of attributes.

2. Corresponding attributes (columns) have the same domain (type).

3. The attributes of R and S must occur in the same order.

Symbol: -

Syntax: R - S

Relational Algebra: R - S

Data Models Data Models Data Models
Next ❯ ❮ Previous
discription of faastop website
logo