The only restriction is a way of expressing the fact that something (for example, some combination of attribute values) must be unique within the whole relationship ("table")).
This is at the level of logical design.
The index is perhaps a useful way to ensure this restriction.
This is at the level of PHYSICAL design.
Some DBMS products can infer certain physical constructs, such as having a certain index, from having certain logical constructs, such as a UNIQUE constraint. Others cannot.
Erwin smout
source share