Here, we are explaining a simpler way to each key :
Candidate Key:
Candidate keys are those keys which is candidate for primary key of a table. In simpler we can understand that such type of keys which full fill all the requirements of primary key which is not null and have unique records is a candidate for primary key. So thus type of key is known as candidate key. Every table must have at least one candidate key .
Primary Key:
Such type of candidate keywhich is chosen as a primary keyfor table is known as primary key. Primary keys are used to identify tables.There is only one primary key per table.
Foreign Key:
Foreign key are those keys which is used to define relationship between two tables. When we want to implement relationship between two tables then we use concept of foreign key. It is also known as referential integrity.
Alternate Key:
If any table have more than one candidate key, then after choosing primary key from those candidate key, rest of candidate keys are known as an alternate key of that table.
Composite Key:
When we create keys on more than one column then that key is known as composite key. I have a table Employee which has two columns Empid and EmpReferenceNo and we make primary key on these two column. Then this key is known as composite key:
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
Anupam Mishra
28-Feb-2016