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 fmtonly in sql?

523


What is an ndf file?

520


How can you save or place your msg in a table?

517


What is a common use of group by in sql?

587


Can we use rowid as primary key?

535






What is sql*plus?

563


How to test for null values?

598


How many types of triggers are there in pl sql?

570


What is varchar data type in sql?

512


Is sql open source?

540


i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5

3189


What does a pl/sql package consist of?

510


What is sql data?

542


How to fetch values from testtable1 that are not in testtable2 without using not keyword?

743


Explain the difference between triggers and constraints?

512