Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Difference between primary key and unique key ?

Answers were Sorted based on User's Feedback



Difference between primary key and unique key ?..

Answer / ranjeet kumar

There is only one primary key in a table but multiple unique
key.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / shakeel shikari

the difference is only primary key does not accept null values
while unique key accept null value
remember that unique key holds null only once

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / ankit kumar singh

Primary Key:
* Primary Key can not contain null value
* Clustured index is created in Primary key.
* Primary Key allows Each row in a table to uniquely
identified and insures that no applicable row exists.

Unique Key:

* Unique Key can contain null value.
* More than one Unique key in a table can be declared.
* Non-clustered index is created in unique key.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / susil kumar rout

When we applied primary key constraint upon a column of a table internally oracle create a cluster index.In case of unique constraint,oracle create a non-cluster index.
In a table or entity one primary key and one or more than one
unique key can be applied.
We can't insert duplicate value or null value to primary key
column where as null value can insert into unique key column.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / nithin

1. There can be more than one unique key in a row or table
but there can be only one primary key in a row or table.

2. Primary key does not accept NULL values but Unique key
accepts even NULL values.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / arpit sachan

Primary key Accept only one Null Value...But a Unique key Accept one or More Null value........

create table #foo(id varchar(5)primary key,name varchar(10));

insert into #foo('','Your name');

---------->> see the result.....

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / omkar

In any table there can be one and only one primary key
(composite priamry key can have more than 1 column but
together conside one key only) but more than one unique
keys.

Primary key cannot accecpt null value.unique key accecpts
one or more than one null values.

primary key uniquly identifies the table but unique key is
used for uniquly identified of table as it contain one or
more than onee null.

Clustered index is created on
Primary key constraint and non clustered unique indexes is
created on Unique key constraint.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / madhusudan reddy paila

Primery Key is allows the null value but unique wont accept
the null values in database ....

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / dinesh

Primary Key:
It wont accept NULL values.
It wont accept Duplication.
Unique Key:
It accepts NULL values.
Foreign Key:
It accepts NULL values.
It accepts Duplication.
Main point is, A Foreign key denotes a Primary key in the another table.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / chandra bhan kumhar

1. Primary key accepts a value only single time not more then one time means it doesn't allow repetition same as for unique key.
2. Primary key don't allow null values ,but unique key allow null values.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

What is trigger associated with the timer ?

1 Answers   Oracle,


How to create a new table by selecting rows from another table?

0 Answers  


What is the maximum number of triggers that can be applied to a single table?

0 Answers  


what are different types of deletes?

1 Answers  


What is the difference between truncate & delete command?

0 Answers  


Is primary key = unique key,not null? If yes,please explain IF No,please explain

8 Answers   Genpact,


What a SELECT FOR UPDATE cursor represent.?

1 Answers  


Explain the dml?

0 Answers  


How to write a query with a right outer join in oracle?

0 Answers  


How to call a stored procedure inside a trigger? Give an example.

1 Answers   Exilant,


How to get a create statement for an existing table?

0 Answers  


SQL> CREATE TABLE to_table 2 (col1 NUMBER); Table created. SQL> CREATE OR REPLACE TRIGGER statement_trigger 2 AFTER INSERT ON to_table 3 BEGIN 4 DBMS_OUTPUT.PUT_LINE('After Insert Statement Level'); 5 END; 6 / Trigger created. SQL> CREATE OR REPLACE TRIGGER row_trigger 2 AFTER INSERT ON to_table 3 FOR EACH ROW 4 BEGIN 5 DBMS_OUTPUT.PUT_LINE('After Insert Row Level'); 6 END; 7 / Trigger created. SQL> INSERT INTO TO_TABLE VALUES(1); After Insert Row Level After Insert Statement Level 1 row created. SQL> BEGIN 2 INSERT INTO TO_TABLE VALUES(2); 3 INSERT INTO TO_TABLE VALUES(3); 4 INSERT INTO TO_TABLE VALUES(4); 5 INSERT INTO TO_TABLE VALUES(5); 6 INSERT INTO TO_TABLE VALUES(6); 7 INSERT INTO TO_TABLE VALUES(7); 8 INSERT INTO TO_TABLE VALUES(8); 9 INSERT INTO TO_TABLE VALUES(9); 10 INSERT INTO TO_TABLE VALUES(0); 11 END; 12 / WAT LL BE THE O/P??? XPLAIN IT>>>>

1 Answers   Infosys,


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)