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...


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

Answers were Sorted based on User's Feedback



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

Answer / arti kesharwani

No they are not equal because
we can have more than one column with not null+Unique constraints but we can have only one primary key in the table.
e.g
we can not create a table like this
create table test(id number primary key , name varchar2(10) primary key)
but we can create
create table test(id number unique not null , name varchar2(10) unique not null)

Is This Answer Correct ?    19 Yes 0 No

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

Answer / anamika niit

Primary key and unique are Entity integrity constraints

Primary key allows each row in a table to be uniquely
identified and ensures that no duplicate rows exist and no
null values are entered.

Unique key constraint is used to prevent the duplication of
key values within the rows of a table and allow null
values. (In oracle, one null is not equal to another null).

Is This Answer Correct ?    16 Yes 2 No

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

Answer / chanchal

a primary key can be a unique key but a unique key
may be or may not be a primary key bcoz primary key cant be
NULL but Unique Key may.
in a table more than one unique key but only one primary key

Is This Answer Correct ?    5 Yes 0 No

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

Answer / kirti

Yes.When a column is assigned primary key it means it
contains unique value(i.e. no duplicate value is allowed) &
it can't accept null values.
Whereas unique key means no duplicare value is allowed, but
null value is allowed. And not null means no null value is
accepted but duplicate value can be passed.
So when we assign primary key to a column, the column
becomes both unique & not null.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / neeraj

No, Both are different, If we use the combination "unique+not null" the referential integrity is not maintained and that is not the case with primary key.
I think you got the difference.

Is This Answer Correct ?    3 Yes 1 No

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

Answer / edara satish

More or less both the keys sounds same, but the major
diffrence is where unique will allow null values, because
each null treated as a diffrent value internally. Incase of
primary key it will not allow any repeated data and null
data.

Is This Answer Correct ?    3 Yes 3 No

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

Answer / chandrika

if we define unique key column to not null
then first attempt it not allow to insert null value in
column but after inserting once we can edit its value to
null even if it is not null ( means its allow null)

if we assign primary key then its not allow (in every
situation it not allow null and duplication)

that is main difference between unique key and primery key

Is This Answer Correct ?    0 Yes 7 No

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

Answer / dr umer saleem

We can assign a primary key as a foreign key to other tables
but we can't assign Unique Not Null as a foreign key.

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More Oracle General Interview Questions

what are archived logs?

0 Answers  


How do you find current date and time in oracle?

0 Answers  


diff between DELETE and TRUNCATE?.

14 Answers   HCL, Yalamanchili Software,


Why does oracle 9i treat an empty string as null?

0 Answers  


What are the advantages of oracle?

0 Answers  


A table t is there.If you perform insert ,update and delete then the trigger will fire.What is the minimum no of trigger required for a table.

3 Answers  


when we are importing items in inventory, showing errors, Oracle support suggested us for running scripts & also suggested if we run scripts, iprocurement applicaation if is there it will show shared and if we go in future for iprocurement, it wont work. So kinldy suggest any functional solution.

0 Answers  


How can return max date row A b c d e 1 2 1-mar-09 5 10 1 2 10-mar-09 5 10 Only using oracle predefined function. Not user defined. Output:-- A b c d e 1 2 10-mar-09 5 10

2 Answers  


Please HELP me its urgent? If i want to EXPORT data from SQL server to ORACLE 11g then how can I replicate data from SQL to ORACLE?

3 Answers  


How to use group functions in the select clause using oracle?

0 Answers  


13. Display the second to fifth characters in each client name.

2 Answers   Wipro,


How to establish administrator authentication to the server?

0 Answers  


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)