- Formal query languages are based on mathematical relations. Thus no duplicates appear in relations.
- As duplicate removal is expensive, SQL allows duplicates.
- To remove duplicates, we use the
**distinct**keyword. - To ensure that duplicates are not removed, we use the
**all**keyword. -
*Multiset*(bag) versions of relational algebra operators.- if there are copies of tuples in , and satisfies selection , then there are copies of in .
- for each copy of tuple in , there is a copy of tuple in .
- if there are copies of tuple in , and copies of tuple in , there is copies of tuple in .

- An SQL query of the form
**select****from****where***P*is equivalent to the algebra expression

using the multiset versions of the relational operators , and .

Fri May 22 19:39:12 PDT 1998