# 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);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vikram-bajaj.gitbook.io/cs-gy-6083-principles-of-database-systems/sql/dml-commands/test-for-duplicate-tuples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
