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

Is record in oracle pl sql?

535


Why do we use procedures in sql?

554


What is the difference between stored procedure and view?

534


Is it possible to remove child records without removing master table records...the two having pk,fk relationship?

809


What is pl sql in oracle?

585






What does a pl/sql package consist of?

518


What is the difference between numeric and autonumber?

502


what is the difference between char and varchar data types? : Sql dba

543


Is clustered index a primary key?

537


State few characteristics of pl/sql?

569


How to run pl sql program in mysql?

516


What is the need of a partition key?

541


what is the difference between where clause and having clause? : Sql dba

543


Which is better stored procedure or query?

550


Explain autonomous transaction.

640