Can a table have two primary keys?

Answer Posted / dan

Kumar Navdeep Shanker

I have created the table provided and it works well.
You said that is possible to have two primary key, I am
sorry I have to disagree with you and all who said yes.

Let me explain using your table

cno balance cname
1 2 w
2 2 x
1 3 r
primary key no two tuple have the same value

what you are providing is a composite key

Thus, we can have more than one key in a table that the
compinaition of the keys are unique

BUT we have only one primary key that means it is unique

Please correct me if i am wrong

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

556


What is a table in a database?

579


What is the left table in sql?

517


What is difference between rank () row_number () and dense_rank () in sql?

579


What are crud methods?

551






what are date and time data types in mysql? : Sql dba

502


How does left join work in sql?

519


What is package in pl sql with an examples?

549


How do you delete data from a table?

546


Can sql function call stored procedure?

557


which types of join is used in sql widely? : Sql dba

539


What is #table in sql?

522


How does stored procedure reduce network traffic?

544


Mention what is the function that is used to transfer a pl/sql table log to a database table?

486


What is a rank in sql?

538