Subquestioning my question "Why to use “not null primary key” in TSQL?" [1]
As I understood from other discussions, some RDBMS (for example, MySQL, SQLLite, which else?) permit "unique" NULL in primary key (PK).
I read-read and could not grasp - why and what's for?
Update:
I believe it is beneficial for communication with other colleagues and database professionals to know the differences in basic fundamental concepts, approaches and their implementations in different DBMS.
Please add also RDBMS to "NULL PK" and "NOT NULL Primary Key" lists.
Update2:
MySQL is rehabilitated and returned to the "NOT NULL PK" list [2].
SQLLite is added (thanks to Paul Hadfield comment [1a]) to "NULL PK" list [3]:
"For the purposes of determining the uniqueness of primary key values, NULL values are considered distinct from all other values, including other NULLs. If an INSERT or UPDATE statement attempts to modify the table content so that two or more rows feature identical primary key values, it is a constraint violation. According to the SQL standard, PRIMARY KEY should always imply NOT NULL. Unfortunately, due to a long-standing coding oversight, this is not the case in SQLite. Unless the column is an INTEGER PRIMARY KEY SQLite allows NULL values in a PRIMARY KEY column. We could change SQLite to conform to the standard (and we might do so in the future), but by the time the oversight was discovered, SQLite was in such wide use that we feared breaking legacy code if we fixed the problem. So for now we have chosen to continue allowing NULLs in PRIMARY KEY columns. Developers should be aware, however, that we may change SQLite to conform to the SQL standard in future and should design new programs accordingly." [3]
Update:
I am surprised to see that answers that do not even address my question
(stating well-known and easily available/searchable on internet facts) are more upvoted.
[1]
"Why to use “not null primary key” in TSQL?"
http://stackoverflow.com/questions/3905703/why-to-use-not-null-primary-key-in-tsql
[1a]
Comment to my question [1] by Paul Hadfield giving the reference to [3]
[2]
Answer of Hammerite to this post.
http://stackoverflow.com/questions/3906811/null-permitted-in-primary-key-why-and-in-which-dbms/3907195#3907195
[3]
SQL As Understood By SQLite. CREATE TABLE
http://www.sqlite.org/lang_createtable.html