English

Differentiate between primary key and candidate key.

Advertisements
Advertisements

Question

Differentiate between primary key and candidate key.

Distinguish Between
Advertisements

Solution

Basis of Difference Primary Key Candidate Key
Meaning The key selected to uniquely identify rows. Any key eligible to be selected as the primary key.
Number in a table Only one primary key is selected. A table may have one or more candidate keys.
NULL values Cannot contain NULL values. Candidate keys must also uniquely identify records and are normally not null.
Selection Chosen from the candidate keys. May or may not be selected as the primary key.
Example AdNo selected as the key. Both AdNo and Name may be candidate keys.
shaalaa.com
  Is there an error in this question or solution?
Chapter 9: Databases Concepts and SQL - EXERCISE [Page 174]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 9 Databases Concepts and SQL
EXERCISE | Q 15. | Page 174
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×