The Artima Developer Community
Sponsored Link

Java Buzz Forum
Difference between primary key vs Candidate Key in table - SQL database

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
Difference between primary key vs Candidate Key in table - SQL database Posted: Oct 22, 2012 9:46 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: Difference between primary key vs Candidate Key in table - SQL database
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement


Primary key vs Candidate Key
What is difference between primary key and candidate key is another popular SQL and database interview questions which appears in various programming interviews now and then. Concept of primary key and candidate key is not just important from interview point of view but also on designing database and normalization. By the way this is my second post in primary key, In last one we have seen comparison of primary key vs unique key, which is also happens to be one of the frequently asked database question. By definition primary key is a column or collection of columns, which uniquely define a row in a table. Candidate keys are keys which can be primary key and also able to uniquely identify any row in table. In simply terms you may have couple of Candidate keys and you have choose one of them as primary key. This selection part is the most important skill in database design. Since only primary key can have clustered index in table while unique keys can have Nonclustered index, its important to choose right column or collection of columns as primary key. Often I select a column which is most frequently used in Where clause of SELECT query. If you preparing for SQL interview or looking for some good SQL interview question than you can also check difference between Correlated and Noncorrelated subqueries and  When to use truncate vs delete in SQL.
Read more »

Read: Difference between primary key vs Candidate Key in table - SQL database

Topic: CometD: Facebook similar chat for your Java web application Previous Topic   Next Topic Topic: Java Unit Testing JUnit 3.8

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use