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

Which type of cursor is used to execute the dml statement?

534


Define a temp table?

555


What are the syntax and use of the coalesce function?

554


What is the difference between the repeatable read and serializable isolation levels? : Transact sql

537


Can a table have no primary key?

560






Explain the select statement in sql?

616


How to assign sql query results to pl sql variables?

515


What is a pl/sql block?

595


How does a self join work?

521


Why functions are used in sql?

513


what is a control file ? : Sql dba

580


What is the use of count (*) in sql?

551


i have a column which may contain this kind of value: 123*67_80,12*8889_5,34*8_874 ,12*7_7 (can contain space before a comma, and this string length can be anything) now i want to split this value into two column like: column1: 123*67,12*8889,34*8,12*7 column2: 80,5,874,7 use function for this

1067


How does cross join work?

504


how many tables will create when we create table, what are they? : Sql dba

548