Diff b/w primary key & Candidate key ?



IBM's flagship relational database management system

Diff b/w primary key & Candidate key ?

Postby ragur.satheesh » Mon Dec 13, 2010 12:16 pm

Diff b/w primary key & Candidate key ?
ragur.satheesh
 
Posts: 17
Joined: Thu Jul 22, 2010 12:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Diff b/w primary key & Candidate key ?

Postby GuyC » Mon Dec 13, 2010 2:15 pm

the definition of them
GuyC
 
Posts: 315
Joined: Tue Aug 11, 2009 3:23 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Diff b/w primary key & Candidate key ?

Postby ankesh.cs2007 » Sun Jan 16, 2011 10:20 am

The primary key of a table is the column that uniquely identify the columns of that table. Primary key should be unique and not null.
Where as candidate key all those columns which are capable of being a primary key but not designated as primary key.
ankesh.cs2007
 
Posts: 4
Joined: Wed Jan 12, 2011 1:46 am
Location: meerut, india
Has thanked: 0 time
Been thanked: 0 time

Re: Diff b/w primary key & Candidate key ?

Postby dick scherrer » Sun Jan 16, 2011 10:31 am

Hello,

Where as candidate key all those columns which are capable of being a primary key but not designated as primary key.
Please post the link to the manual or other documentation that says this. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Diff b/w primary key & Candidate key ?

Postby ankesh.cs2007 » Tue Jan 18, 2011 10:53 pm

hay check out this link may this help
http://dotnetslackers.com/articles/sql/ ... y-Key.aspx
ankesh.cs2007
 
Posts: 4
Joined: Wed Jan 12, 2011 1:46 am
Location: meerut, india
Has thanked: 0 time
Been thanked: 0 time

Re: Diff b/w primary key & Candidate key ?

Postby dick scherrer » Wed Jan 19, 2011 1:37 am

Hello,

Please post the link to the manual or other documentation that says this. . .
The link posted is someone's personal article. Which is about an approach that i have never needed (but then, i've only been involved with the definition and implementation of a few hundred databases (not tables - thousands of them)).

Personally, i believe that proper design will almost always have the "primary key" jumping up and down making itself visable. Long ago this little "rule" was published about a primary key:
"every non-key attribute "must provide a fact about the key, the whole key, and nothing but the key - so help me Codd

fwiw
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post