The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
difference beween
UNIQUE KEY PRIMARY KEY and a regular KEY |
#2
|
||||
|
||||
![]()
there can only be ONE primary key, it's usually the id key.
normally the datablocks are stored in order to this key (if you have an autoindex for example) unique key means, that every value is there only once, no two rows can have the same unique key (for example username of the usertable) each primary key is a unique key, but not every unique key is a primary of course |
#3
|
||||
|
||||
![]()
and a regular key is an index key that does not have to be unique.
|
#4
|
||||
|
||||
![]()
unfortunatelly the name is badchosen, as an index is not really a key.
regarding databasetheory, a key has to identify a single row. and a normal key in mysql doesn't identify. so if you hear a someone talking about a key in the theoretical aspect, he always means a unique key ![]() |
#5
|
||||
|
||||
![]()
Thanks everyone!
So the difference between a PRIMARY KEY and a UNIQUE KEY is that a UNIQUE key can be NULL and a PRIMARY KEY cannot be NULL? |
#6
|
||||
|
||||
![]()
short said: yes ^^
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|