1. Home
  2. Docs
  3. Chapter 14. Database Design & Engineering
  4. 2. Database Designer’s Guide
  5. Working with unique constraint

Working with unique constraint

Download PDF

Unique constraints help to enforce the uniqueness of specific columns. You can add unique constraints to an entity to make sure that no duplicate values are entered in specific columns. A unique constraint may consist of a single column, or combination of columns.

Creating a unique constraint

To create a unique constraint:

  1. Right click on the entity and select Open Specification… from the popup menu.
  2. Open the Constraints tab.
  3. At the bottom right of the specification window, click Add > Unique Constraint….
    Add a unique constraint
  4. In the Unique Constraint Specification window, enter the name of the constraint.
    Name the unique constraint
  5. Select the columns to be included and click >.
    Add columns to the constraint
  6. Click OK to return to the Entity Specification.
  7. Click OK to return to the diagram. You can see the selected column(s) is marked unique.
    Columns marked unique

Showing the name of unique constraints in entity

To show the name of unique constraint in entities in an ERD, right click on the ERD and select Presentation Options > Entity Columns Display Options > Show Column Unique Constraint Name from the popup menu. With enough shape width, you can see the constraint names of columns.

Constraint name shown