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 is difference between sql and oracle?

572


What are different types of functions in sql?

515


What is a sql*loader control file?

622


explain the difference between delete , truncate and drop commands? : Sql dba

556


What is the maximum number of rows in sql table?

553






Why coalesce is used in sql?

476


Does sqlite need a server?

548


what is the difference between delete and truncate commands? : Sql dba

544


What is rename in sql?

558


Which command is used to delete a trigger?

781


Is not null in sql?

570


How do I delete a trigger?

548


What are views in sql?

550


How you improve the performance of sql*loader? : aql loader

584


How does an execution block start and end in pl sql?

504