ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Databases  >>  SQL PLSQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
Can a table have two primary keys?
 Question Submitted By :: Pk
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Can a table have two primary keys?
Answer
# 1
No,In the entire  table,there will be only one primary key.
A primary key is nothing but a collection of one or more 
coloumns  used to identify a row in a table.
 
Is This Answer Correct ?    6 Yes 0 No
Karunakar Reddy
 
  Re: Can a table have two primary keys?
Answer
# 2
yes any table has only one primary key.but the basic idea 
of pk is ....primary key=NOTNULL+UNIQUE KEY.which we can 
give any column to a table and act as primary key
 
Is This Answer Correct ?    5 Yes 0 No
Sankar
 
 
 
  Re: Can a table have two primary keys?
Answer
# 3
yes, a table may have more than 1 primary keys but, of them
we only choose 1 column as identifiable column called
primary key. The other columns are called surrogate keys or
candidate key.
 
Is This Answer Correct ?    1 Yes 3 No
Ashwin Kumar
 
  Re: Can a table have two primary keys?
Answer
# 4
Yes we can use.  for Example

create table emp(empno number(5), ename varchar2(20), 
deptno number(5) add primary key Pk_constraint( empno, 
deptno))
 
Is This Answer Correct ?    0 Yes 5 No
Jamalvalli
 
  Re: Can a table have two primary keys?
Answer
# 5
no a table can have only one primary key.
u can make one or column to have primary key 
that is called a composite primary key


Dev
ddlamani@yahoo.com
 
Is This Answer Correct ?    3 Yes 0 No
Dev Lamani
 
  Re: Can a table have two primary keys?
Answer
# 6
A table can have Only One Primary key. But a table can have 
composite Primary key. that means we can create composite 
primary key 
upto 16 columns only.

suresh.
suresh_somayajula@hotmail.com
 
Is This Answer Correct ?    1 Yes 0 No
Suresh Somayajula
 
  Re: Can a table have two primary keys?
Answer
# 7
primary key is only and only one in a table.
it may be in more column in table means 
In one table --one primary key and more than one column on 
the same table
 
Is This Answer Correct ?    1 Yes 0 No
Rahul Khanke
 
  Re: Can a table have two primary keys?
Answer
# 8
Hi
A table can have only one primary key.but a primary key can
have two column fields
Ex i have a employee table.and i have fields eno,ename,esal
i can declare primarykey(esal,ename)

let me know if i am wrong
 
Is This Answer Correct ?    0 Yes 2 No
Sowmya
 
  Re: Can a table have two primary keys?
Answer
# 9
A table can have only one primary key constraint but it can 
consist one or multiple columns.If a primary key is made up 
of more than one columns then it is know as composite 
primary key.

VD
 
Is This Answer Correct ?    1 Yes 0 No
Vaibhavi_dixit
 
  Re: Can a table have two primary keys?
Answer
# 10
create table emp
(empno varchar2(10) constraint empnopk primary key,
e_id varchar2(10) constraint eiduk unique not null);
 
Is This Answer Correct ?    1 Yes 0 No
Anish Kumar Anand
 
  Re: Can a table have two primary keys?
Answer
# 11
Yes table can have two or more primary key,when we want to 
create more then one primary we use unique constranit with 
not null or we can create with triggre.
 
Is This Answer Correct ?    0 Yes 0 No
Anand
 
  Re: Can a table have two primary keys?
Answer
# 12
ya..it's possible when, a table contains more than one
fields. we can able to set the primary for two or more..

thanks.,
 
Is This Answer Correct ?    0 Yes 0 No
Murugavel. U
 
  Re: Can a table have two primary keys?
Answer
# 13
A Table can't have two primary key.
 
Is This Answer Correct ?    0 Yes 1 No
Dev
 
  Re: Can a table have two primary keys?
Answer
# 14
Yes table can have two or more primary key.
 
Is This Answer Correct ?    0 Yes 1 No
Sandeep Yadav
 
  Re: Can a table have two primary keys?
Answer
# 15
yes table can contain one or more than one primary keys 
but only one is considered as a primary key .
 
Is This Answer Correct ?    0 Yes 1 No
Sruthi
 
  Re: Can a table have two primary keys?
Answer
# 16
yes
 
Is This Answer Correct ?    1 Yes 0 No
Yes
 
  Re: Can a table have two primary keys?
Answer
# 17
No, a table should allows only one primary key with the 
properties of NOT NULL + UNIQUE  . But user can be able to 
give more than one primary keys in a table with the help of 
NOT NULL and UNIQUE KEYs but not directly using PRIMARY KEY 
constraint.
 
Is This Answer Correct ?    2 Yes 0 No
Subbarayulu
 
  Re: Can a table have two primary keys?
Answer
# 18
No, a table can have one and only one primary key.
 
Is This Answer Correct ?    1 Yes 0 No
Saurabh
 

 
 
 
Other SQL PLSQL Interview Questions
 
  Question Asked @ Answers
 
Store procedure will return a value? eMids2
can use the following like overloading concept in a single package: procedure p1(a varchar), procedure p1(a varchar2), procedure p1(a char)  5
What is the best strategy to use COMMIT in a pl/sql loop?  2
Differentiate between %type and %rowtype attribute in Oracle PL/AQL programming ? PreVator3
What is oracle ? why we should go for oracle database instead of diffrent databases available in the industry. Polaris3
When the mutating error will comes? and how it will be resolved?  1
what is variable in package specification  2
What is the difference between RDBMS and DBMS? Stag-Computers5
What are two parts of package ? Infosys2
What is CYCLE/NO CYCLE in a Sequence?  1
using subquery how can i calculate working days in a month? Spice-Telecom1
What is the first action to perform a query? Suppose I have four tables and five joins and my query is getting slow day by day. Hexaware3
What is a trigger ? BirlaSoft6
what is oracle sql,pl/sql with interfaces TCS1
can we call a procedure into another procedure?If yes means how you can pass the perameters for the two procedures?  2
Which one of the following join types will always create a Cartesian Product? 1. CROSS JOIN 2. LEFT OUTER JOIN 3. RIGHT OUTER JOIN 4. FULL OUTER JOIN 5. INNER JOIN  2
full outer join syntax  1
What will happen after commit statement ?  2
what is constraining table?  1
What is a constraint. Types of constraints ? BirlaSoft4
 
For more SQL PLSQL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com