Definition for Candidate,Alternate and Composition key

  • Hi, Composite key - A key formed by combining more than 1 column, can we say, in this composite key, one of the column is primary key(Candidate key)and others as alternate key(since, alternate key=if more than 1 column is used to identify a row uniquely, 1 of the column is primay and the other is alternate)

    I'm not getting an clear cut definition for Candidate,Alternate and Composition keys. Can anybody define wit real time examples. Thank in advance.

  • Hi,

    A composite key is one that uniquely identifies a row by utilising more than one column.  For example consider a table called Book, which contains details on books.

    To uniquely identify a book we could use Title and Author as our composite key.  Title on its own cannot be a key since it is possible that two different authors have written a book with the same title.  Conversely, Author cannot be a key because an author could have written many books.

    Now, let's assume we also want to store the ISBN number for the book in this table.  This number uniquely identifies a book so we could use ISBN for our primary key instead of Title + Author.  So therefore, ISBN is an alternate key because we can use it (alternatively) to uniquely identify a book.  I guess you could say that ISBN is the candidate key and Title + Author is an alternate (composite) key.

    Hope that helps,

  • Thankq karl

     

  • Thanks Carl,

    Can you please tell me about the View

    Can we update the record from view.

    If yes then in which condition?

    Thanks in advance.

    Regards,

    Baliram


    Regards,

    Baliram Suryawanshi

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply