What are the differences between an Unique constraint and a Primary Key?
The difference between a UNIQUE constraint and a Primary Key is that per table you may only have one Primary Key but you may define more than one UNIQUE constraints. Primary Key constraints are not nullable. UNIQUE constraints may be nullable.
When you create a UNIQUE constraint, the database automatically creates a UNIQUE index. For MS SQL Server databases, a PRIMARY KEY will generate a unique CLUSTERED INDEX. A UNIQUE constraint will generate a unique NON-CLUSTERED INDEX.
In DeZign for Databases you can create a UNIQUE constraint in the Entity dialog under tab "Table constraints".
Add a unique constraint in DeZign for Databases.
You can add an attribute to the Primary Key by checking the PK checkbox next to the attribute name in the list of attributes under tab "Attributes". You can set the name of the PRIMARY KEY constraint in the "General" tab.
Add an attribute to the primary key.
- Data Modeling with DeZign for Databases: Learn more about the features of DeZign for Databases.
- Database Design Tutorial: Learn how data modeling works.
- Database Normalization: Learn about the 1NF, 2NF and 3NF.
- Build your next data model with DeZign for Databases trial software, available for download directly from our download section.