Editing constraints¶
This page covers table-level unique and check constraints. To edit constraints that belong to a single column (such as its own NOT NULL flag or default value), see Editing columns.
Unique constraints¶
A unique constraint guarantees that the combination of one or more columns is never duplicated. Manage them on the Unique Constraints sub-tab of the Design tab.

To add a unique constraint: click Add in the Unique Constraints group, then set its name, its columns (each with an optional collation and sort order), and a conflict clause. Click OK.

To modify or delete one: select it in the list and click Modify or Delete.
Check constraints¶
A check constraint enforces a rule on the data โ for example, that a quantity is positive or a tax rate is not negative. Manage them on the Check Constraints sub-tab.

To add a check constraint: click Add in the Check Constraints group, then set its name and its expression โ for example:
Click OK.

To modify or delete one: select it and click Modify or Delete.
Check constraints on a single column¶
A check that concerns just one column can be attached to that column instead: open the column on the Columns sub-tab and use the Check Constraints page of the column dialog (see Editing columns).
SQLite enforces both forms identically โ the only difference is where the constraint appears in the table's DDL. SQLite Expert keeps each one where you put it, so a check written on a column stays on that column when the DDL is regenerated.
Note
You must add at least one column to the table before you can add unique or check constraints.
See also: Editing columns ยท Editing primary keys