| |
GeekInterview.com > Interview Questions > Oracle > SQL Plus
| Print | |
Question: What is the basic difference between primary key and (unique key along with Not NULL).
|
| January 01, 2008 06:07:52 |
#8 |
| Sachin Agarwal |
Member Since: January 2008 Total Comments: 1 |
RE: What is the basic difference between primary key and (unique key along with Not NULL). |
The difference is as follows: 1) Basically we define a column/multiple column's as primary key that represents the whole row, A unique key can be any. 2) Primary key are considered as Clustered Index for the table and as we can define only one clustered index for the table, the other columns can only be non-clustered index. 3) We can use primary key in where clause for updating a record as it represents that row which may not be true in case of unique key. Even if the key is unique the table might have a composite key as a primary key. 4) A primary key can act as a foreign key for other related tables, a unique key cannot. 5) The data in a row is dependent on a primary key whereas it may not be for the unique key.
This is all that i know about it. Others can also add some more things to it. |
| |
Back To Question | |