Results 1 to 6 of 6

Thread: Candidate key

  1. #1
    Contributing Member
    Join Date
    Mar 2008
    Answers
    66

    Candidate key

    What is a candidate key in oracle?
    What is difference between candidate key, primary key and unique key?


  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    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.


  3. #3
    Contributing Member
    Join Date
    Mar 2008
    Answers
    66

    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.


  4. #4
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    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.


  5. #5
    Junior Member
    Join Date
    Jul 2008
    Answers
    1

    Re: Candidate key

    I understand what a candidate key is. Can somebody tell me what the syntax is to create one?


  6. #6

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact