Difference between primary key and unique key ?

Answer Posted / dpkar

Primary Key:
Primary key will create column data uniqueness in the table.
Primary key will create clustered index by default
Only one Primay key can be created for a table
Multiple columns can be consolidated to form a single
primary key
It wont allow null values.

Unique Key :

Unique key constraint will provide you a constraint like
the column values should retain uniqueness.
It will allow null value in the column.
It will create non-clustered index by default
Any number of unique constraints can be added to a table.

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does one get the view definition of fixed views/tables?

787


What is literal?

746


How to retrieve the count of updated rows?

759


Is rowid unique in oracle?

720


When system tablespace is created?

777


src name sex a,male b,female c,male d,female Required output : male female a,b c,d tried pivot but was not successfull select * from src pivot (max(name) for sex in ('MALE','FEMALE'));

1409


Can multiple columns be used in group by in oracle?

713


Explain the use of show option in imp command.

827


How to divide query output into groups in oracle?

731


Explain integrity constraint?

855


What is the difference between sharding and replication?

658


Does oracle database need java?

727


How to drop a stored function?

863


Is the After report trigger fired if the report execution fails ?

2669


Is oracle an operator?

686