Why does the database need UNIQUE restrictions?
Can you give any examples?
The default primary key is UNIQUE ... Clear, because they are passed in other tables, because foreign keys ... you need to bind them for the rdbms platform ...
but why you need to refer to other columns as UNIQUE, what is it profitable?)
The username is unique, but not PK. UserId is a PC.
, , . .
, , , , - PK, .
, , , , .
.
Celko .
- , , - , . " " (, ), , .
- .
UQ. PK NULL, UQ 1 (Oracle NULL). 1 PK , UQ ( )
, , . , , . , , ( UserNane). , MSDN :
UNIQUE, , , , . UNIQUE PRIMARY KEY , UNIQUE PRIMARY KEY, , .
, . . , , . , , PK, - .
, ( ), , , .
. , , , , , , . , , , , .
emailID .
the difference between uniqueID and primary key is unique; it supports a single zero in the entire column, but there will be no PC.