-
Contributing Member
Candidate key
What is a candidate key in oracle?
What is difference between candidate key, primary key and unique key?
-
Expert Member
Re: Candidate key
A candidate key uniquely identifies rows in the table.
Any of identified candidate keys can be used as primary key.
Candidate keys that are not part of primary key are called alternate keys.
Primary key will not allow duplicate values and null values.
Foreign key is used to enforce referencial integrity.
-
Contributing Member
Re: Candidate key
You are saying "any of identified candidate keys can be used as primary key."
Does it mean a candidate key must always satisfy the following two conditions
1. Duplicate values are not allowed
2. Null values are not allowed.
But a table can have only one primary key. If each candidate key is a primary key then it is allowing more than one primary key on a table.
Still I did get clear idea about candidate key.
Please clarify it.
-
Expert Member
Re: Candidate key
In other words Candidate keys are all columns in a table that are not dependent on other columns in the table.
All candidate keys are not primary keys. we choose one of the candidate keys as primary key. A table may contain more than one candidate key but only one primary key column per table is allowed.
I hope now it is clear.
-
Junior Member
Re: Candidate key
I understand what a candidate key is. Can somebody tell me what the syntax is to create one?
-
Junior Member
Re: Candidate key
Set of fields in database taken collectively to identify any row uniquely is called Candidate key...
So Database has more than 1 Candidate key...
Primary key is the Candidate key choosen by the Database Designer...
Unique Key is the constraint that is used to insert unique value in the field of the database...
Thanks ,, Vipul Patel
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules