Can a table have two primary keys?

Answer Posted / murali krishna penke

we can create more than one primary key in a table. the
maximum allowed to create primary keys for columns is 16,
but we call it primary key for one column only and the
remaining we call it as composite primary key..

create table TestPrimaryKey(ID int,Name nvarchar(50),Email
nvarchar(50),Phone nvarchar(12),cellphone nvarchar
(10),primary key(ID,Name,Email,Phone,cellphone))

the above table creates primary key for all above mentioned
columns.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is join same as left join?

531


Why procedure is used in sql?

533


what is clause? : Sql dba

589


what are all types of user defined functions? : Sql dba

548


What is a table in a database?

579






What are instead of triggers?

626


Explain table and field in sql?

583


How to pronounce postgresql?

582


what are the t string functions available in tsql? : Transact sql

545


What is the difference between rollback and rollback to statements?

586


what are the differences between char and nchar? : Sql dba

595


What are the different types of dbmss?

563


what is a composite key ? : Sql dba

602


How do you rename a table in sql?

534


How do I edit a trigger in sql developer?

541