Set Difference(-)
A binary operation that gives tuples in one relation but not present in another relation. In simple terms, it returns all the rows from the first relation, which is not present in the second one. For Example: Perform Set Difference Operation in relation R and Relation S.
Relation R-S, After Performing Set Difference operation
Here all the Alphabet which are in R but not in S are shown. Note Preference will be given to the first relation attributes in this case ‘Alphabet’ of relation R.
Set Difference Operator in Relational Algebra
Relational Algebra is used to play with the data stored in relational databases. Relational Algebra has many operations to play with tables. One of the fundamental operations is set difference. This article will discuss Set Difference, its condition, and its examples.