Difference between primary key and unique key ?

Answer Posted / priyranjan das

The basic differences between Primary Key and Unique key are as follows.

1) By default Primary Key will generate Clustured Index
whereas Unique Key will Generate Non-Clustured Index.

2) Primary Key is a combination of Unique and NOT NULL Constraints so it can’t
have duplicate values or any NUll
Whereas for Oracle UNIQUE Key can have any number of NULL whereas for SQL
Server It can have only one NULL

3) A table can have only one PK but It can have any number of UNIQUE Key.

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?

1487


How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?

1813


How to omit columns with default values in insert statement in oracle?

584


How to convert a string to a date in oracle database?

552


1) WIll all the user get the DEFAULT profile, if their current profile got deleted at any point of time? 2) What are the Situation we need to MOVE the TABLE between T.spaces? 3) What is the use of MOVING the TABLE between SCHEMA'S? 4) What are the Table Clause, Segment Clause and the Datafile Clause which will override each other? 5) Explain SORT_AREA_SIZE of Tempfile to make UNIFORM SIZE

1593






List the various oracle database objects?

605


What is query image?

590


ABOUT IDENTITY?

1569


What is the parameter mode that can be passed to a procedure?

581


How to define an anonymous procedure with variables?

556


What are the types of trigger in oracle?

581


Is truncate autocommit in oracle?

648


How to grant create session privilege to a user in oracle?

574


Which dictionary tables and/or views would you look at to diagnose a locking issue?

1493


How do I spool in oracle?

548