> For the complete documentation index, see [llms.txt](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/sql/dml-commands/test-for-duplicate-tuples.md).

# Test for Duplicate Tuples

The **unique** construct tests whether a subquery has any duplicate tuples in its result.

Ex. Find all courses that were offered at most once in 2009:

```
select T.course_id
from course T
where unique (select R.course_id from section R where T.course_id= R.course_id and R.year=2009);
```
