© examsnet.com
Question : 13 of 13
Marks: +1, -0
Differentiate between Candidate Key and Primary Key in the context of Relational Database Model.
OR
Consider the following table PLAYER :
Table : PLAYER
PNONAMESCORE
P1RISHABH52
P2HUSSAIN45
P3ARNOLD23
P4ARNAV18
P5GURSHARAN42
(a) Identify and write the name of the most appropriate column from the given table PLAYER that can be used as a Primary key.
(b) Define the term Degree in relational data model. What is the Degree of the given table PLAYER ?
[CBSE 2022 Code 91]
Solution:  
(A) Candidate Key vs Primary Key
Candidate KeyPrimary Key
An attribute (or set of attributes) that can uniquely identify each tuple of a table.The one candidate key chosen by the database designer to uniquely identify the tuples.
A table may have more than one candidate key.A table has only one primary key.
Candidate keys not chosen as the primary key are called alternate keys.It cannot have NULL or duplicate values.
Example: In STUDENT(RollNo, AdmNo, Name), both RollNo and AdmNo are candidate keys; if RollNo is chosen, it is the primary key and AdmNo becomes an alternate key.
OR (B)
(a) PNO is the most appropriate column for the primary key: every player has a unique, short player number that will not repeat (names can repeat in future).
(b) Degree: The number of attributes (columns) in a relation is called its degree.
Table PLAYER has the columns PNO, NAME and SCORE, so its Degree = 3.
© examsnet.com
Advertisements
Go to Question: