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
What is the use of partition by in sql?
What are the parts of a basic sql query?
mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql
What is write ahead logging in sql server?
what is a unique key ? : Sql dba
explain access control lists. : Sql dba
Does normalization improve performance?
what is a record in a database ? : Sql dba
How do I truncate a sql log file?
Is primary key is clustered index?
How does one load ebcdic data? : aql loader
How insert into statements in sql?
What does select count (*) mean in sql?
How can I make sql query run faster?
Can we edit a view in sql?