Reputation: 1
If a table has only one key then we can say that it is primary key as well as candidate key ??
Upvotes: 0
Views: 34
Reputation: 1221
The answer to your question is YES. For more information, refer the below definition and link:
Candidate Key – A Candidate Key can be any column or a combination of columns that can qualify as unique key in the database. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key.
Primary Key – A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.
Upvotes: 2
Reputation: 721
Candidate Key
– A Candidate Key can be any column or a combination of columns that can qualify as unique key in database. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key.
Primary Key
– A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.
If a table has only one key it can be a primary or candidate depending on your idea.
More Here
Upvotes: 0