relational-algebra

Selecting distinct rows in relational algebra


There is a DISTINCT operator in SQL.

How do I get distinct values from a table using relational algebra?


Solution

  • Relational operators always return distinct tuples so DISTINCT is never needed. Duplicate tuples are not permitted in the RA - that being one major difference between the relational model and the SQL model.