> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baenninger.me/llms.txt
> Use this file to discover all available pages before exploring further.

# UNIQUE

Der Constraint `UNIQUE` versichert uns, dass alle Werte in einem Attribut einzigartig sind.

```sql theme={null}
CREATE TABLE Persons (
    Id INTEGER NOT NULL,
    LastName VARCHAR(45) NOT NULL,
    FirstName VARCHAR(45),
    Age INTEGER,
    CONSTRAINT UQ_Person_LastName UNIQUE (LastName)
);
```

```sql theme={null}
ALTER TABLE Persons
ADD CONSTRAINT UQ_Person_LastName UNIQUE (LastName);
```

```sql theme={null}
ALTER TABLE Persons
DROP INDEX UQ_Person_LastName;
```
