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
Can you join a table to itself?
How do I make my sql query run faster?
what is a primary key? : Sql dba
Can a table have no primary key?
what is heap table? : Sql dba
Why use truncate instead of delete?
how can you create an empty table from an existing table? : Sql dba
What is java sql drivermanager?
How do I view a sql database?
What does select top 1 do in sql?
Can we commit in trigger?
How show all rows in sql?
What is cascade in sql?
State some properties of relational databases?
What is partition in sql query?