retagged by
516 views

2 Answers

Best answer
1 votes
1 votes

You cannot declare two primary keys in one table.
However, you can declare one primary key with multiple columns. This is perfectly fine. There is no requirement that a primary key (or any key) have only one column.

And if you want to know more then see the link below ..

https://www.quora.com/What-is-the-use-of-two-primary-keys-for-one-table-in-SQL

Hope this link will help you to understand the concept of primary key.

selected by
1 votes
1 votes
No it is not possible for a table to have more than one primary key . however many columns can be part of primary key which is called composite primary key .

why : it is defined as such by dbms and primary means main key so one main is fine why to declare many main keys

Related questions

0 votes
0 votes
0 answers
2
aashijn asked Apr 28, 2022
1,391 views
employee (person-name, street, city)works (person-name, company-name, salary)company (company-name, city)manages (person-name, manager-name) a. Find the names of all empl...
3 votes
3 votes
2 answers
3
Ram Swaroop asked Jan 30, 2019
1,299 views
Consider the following relation R(A1, A2,...A15) with (A1,A2, ... A6) of relation R are simple candidate key. The number of possible superkey in relation R is_
0 votes
0 votes
3 answers
4