Selecting DISTINCT rows in relational algebra

Karan picture Karan · Jan 23, 2011 · Viewed 29.4k times · Source

There is a DISTINCT operator in SQL. However, I have an assignment in which I need to get some distinct values from a table, and I can only use relational algebra. Is there a way?

Answer

nvogel picture nvogel · Feb 2, 2011

Relational projections 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.