Home » SQL & PL/SQL » SQL & PL/SQL » Unique vs PK
Unique vs PK [message #233903] Sat, 28 April 2007 01:16 Go to next message
knight07
Messages: 8
Registered: April 2007
Junior Member
Hello all:
I'm new to oracle and I have a little question!
A PK is a constraint that guarantees the uniqueness of the values of a column.
Then, how does the constraint unique differ from it.
Thanks.
Re: Unique vs PK [message #233906 is a reply to message #233903] Sat, 28 April 2007 01:44 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Welcome to the forum!

Here you will find some links to answers to this question. The difference is quite vague.
In short: PK-columns can not be NULL, and you can have only one PK per table.

[Updated on: Sat, 28 April 2007 01:45]

Report message to a moderator

Re: Unique vs PK [message #233924 is a reply to message #233906] Sat, 28 April 2007 04:44 Go to previous messageGo to next message
knight07
Messages: 8
Registered: April 2007
Junior Member
Thanx Frank. That's enough for me to know for now and I'll check the link for more info. Razz
Re: Unique vs PK [message #233948 is a reply to message #233924] Sat, 28 April 2007 07:28 Go to previous messageGo to next message
gururajster
Messages: 26
Registered: October 2006
Location: bangalorre
Junior Member

Hi,

Primary -key on a column means, column cannot contains a value which is duplicate and null.

But Unique will allow null values to be inserted.

Thanks,
Guru
Re: Unique vs PK [message #233960 is a reply to message #233948] Sat, 28 April 2007 07:55 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Oh, wow. Thanks for this very informative additional info.

Did you read my previous reply?
Previous Topic: ODBC configuration?
Next Topic: join query between two same table structure
Goto Forum:
  


Current Time: Thu Dec 08 02:30:10 CST 2016

Total time taken to generate the page: 0.12275 seconds