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 memory optimized table?
What is the difference between microsoft sql and mysql?
What is the difference between subquery and correlated query?
What is auto increment feature in sql?
How does a covering index work?
What is cost in sql execution plan?
What is trigger types in sql?
Enlist some predefined exceptions?
How do you pronounce sql?
How to get list of all tables from a database?
What is the primary use of normalization?
What are sql data types?
What is db journal file?
Is sql open source?
What is the use of sqldataadapter?