Remove Duplicates

For any relation R and any subset of its attributes K, let RemoveDuplicates(R,K) denote the relation obtained from R by removing duplicate tuples according to their projection on K.

This function can be expressed in the relational algebra. Here we (roughly speaking) use Tutorial D notation.

    RemoveDuplicates(R,K)  =  (R GROUP (ALL BUT K) AS Y WHERE COUNT(Y)=1) UNGROUP Y

    Duplicates(R,K) = R MINUS RemoveDuplicates(R,K)