View previous topic :: View next topic
|
Author |
Message |
rajesh822 Currently Banned New User
Joined: 22 Sep 2005 Posts: 5
|
|
|
|
what is the difference between primary key and unique key? |
|
Back to top |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
Primary Key is Unique and NotNull
UniqueKey --The Values should be Unique and can be null even
for further info on this one,please search the previous posts in this forum.
hope this helps. |
|
Back to top |
|
|
SWAPNA LATHA
New User
Joined: 13 Jun 2005 Posts: 3
|
|
|
|
one more addition to the above question......
if unique key allows null values and more than one record has null entries,then how is uniqueness maintained????? |
|
Back to top |
|
|
radhakrishnan82
Active User
Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
Back to top |
|
|
SWAPNA LATHA
New User
Joined: 13 Jun 2005 Posts: 3
|
|
|
|
thanks radhakrishna
this answers my query... |
|
Back to top |
|
|
nijugopalan
New User
Joined: 15 Oct 2005 Posts: 15 Location: pune
|
|
|
|
all the keys used in the table which have unique values are unique keys.while the unique key which is selected to identify records is the primary key while all other keys are alternate keys.
ALL PRIMARY KEYS ARE UNIQUE KEYS WHILE ALL PRIMARY KEYS CANNOT BE AN UNIQUE KEYS.
THIS IS CORRECT NAA. MY FREINDS. |
|
Back to top |
|
|
ravisan Warnings : 1 New User
Joined: 13 Sep 2005 Posts: 13 Location: chennai
|
|
|
|
One more differance is there......
A table may contains no of unique key. But it must contains only a primery key
Regards,
Ravisan |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
hi frnd,
the primary key is let active when any the unique index is create. its same like unique value. ie., the unique key can have only one null value and it cannot have any foreign key ref. as the primary key cannot have a null value and can have ref to any foreign key. hope enough |
|
Back to top |
|
|
|