A unique constraint protects data integrity by requiring values in a specified column or group of columns to remain distinct within a table. section 2.3.1
A unique constraint supports relational integrity by:
- Preventing duplicate values in the constrained column or column group. section 2.3.1
- Allowing a foreign key to reference a column that is not a primary key, provided that column has an associated unique constraint. section 2.3.2
- Supporting fast foreign-key verification through the index created for unique columns. section 2.3.2
Using a primary key as the unique reference
The products.catalog table uses id as its primary key, so id is unique by definition and can be referenced by products.reviews.product_id. A foreign-key definition would fail if the referenced catalog column had no matching unique constraint. section 2.3.2






