Can a table have two primary keys?

Answer Posted / satish reddy

Each table can have only one primary key; however, that key may consist of more than one column.

SQL> create table EMP(EMPNO Number(5),EMPNAME Varchar2(10),ADDRESS Varchar2(10),Constraint Multi_Constr
aint Primary Key(EMPNO,EMPNAME));

After creating table try to insert null value into EMPNAME Column, it will throw an error "cannot insert NULL into ("SCOTT"."EMP"."EMPNAME")"

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

548


What is pl sql package?

591


How many types of relationship are there?

545


Does pl sql work in mysql?

531


What is the starting oracle error number? What is meant by forward declaration in functions?

538






how to use regular expression in pattern match conditions? : Sql dba

522


What is PL/SQL Records?

624


how many ways we can we find the current date using mysql? : Sql dba

611


what is the use of friend function? : Sql dba

538


Explain select statements in sql?

584


what is the difference between a web-garden and a web-farm? : Sql dba

556


what is a cursor? : Sql dba

552


How do I access sql anywhere database?

495


What are the types of operators available in sql?

552


What do you mean by table in sql?

524