Home » SQL & PL/SQL » SQL & PL/SQL » Primary key and unique
Primary key and unique [message #801] Tue, 05 March 2002 04:39 Go to next message
shishir
Messages: 2
Registered: March 2002
Junior Member
1) what is the difference between primary key and unique key?
2) How many nulls are allowed when u give a unique key to a column
3) Is the index created by default when u create a table if yes why do u use a separate index.
Re: Primary key and unique [message #802 is a reply to message #801] Tue, 05 March 2002 05:42 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
1.
a.primary key=unique key+ not null
b.there can be only one primary key for one table . but there can be zero or more unique key
c.primary key is necesary to create foreign keys
2. there is no restriction on the number of nulls allowed when u give a unique key to a column
3.when u create table , index is not created . table and index are differnt. table can exist without index , but index can not.
Previous Topic: error, if run from sql prompt
Next Topic: Re: error from sql (win) prompt
Goto Forum:
  


Current Time: Sun May 05 09:05:26 CDT 2024