Can a table have two primary keys?

Answer Posted / uhaish

Yes and it can and the number of primary keys in a single
table is not limited and can be 3,4, unlimited .The concept
is imagine 2 primary keys cols in a table as one primary
key col .
which means if you have two cols A and B both are primary
key by defination then..
AB
00
01
02
12
21
21
22

,see individually a primary key col is not anymore unique
but as hole its unique no other row in a table can have the
same combination of these two primary keys i.e '02' cannot
be repeated .

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is foreign key? : Sql dba

589


What is duration in sql profiler trace?

557


What is the difference between stored procedure and view?

532


How is pl sql different from sql?

548


Should I use mbr or gpt?

546






What is the difference between delete and truncate statement in sql?

500


What is use of trigger?

515


Can we join tables without foreign key?

522


How do I copy a table in sql?

517


what is data manipulation language? : Sql dba

531


Is it possible for a table to have more than one foreign key?

582


how to use case expression? : Sql dba

556


What is the difference between microsoft access and sql server?

533


What are records give examples?

566


How to combine two stored procedures in sql?

595