> > A primary key absolutely forbids duplicate values.
> >
> > Indexes created with the UNIQUE keyword do not allow duplicates, except
> > for the special case that multiple NULL values are allowed.
>
> I realise that it may (and is) defined in such a way, but it still does
not
> explain *why* part of a PRIMARY key might not be NULL.
Because a value in a PK should uniquely identify a row.
Using one or more NULLs negates this...
The best systems don't use NULLs at all. NULL is an abomination.
You should only store "values" that are "true".
Eg: employee with number 1 has a name of "Martijn".
If "salary" is optional, do not make it nullable, but create a separate
table "employee_salaries".
This way, there's never NULL confusion either.
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com