Delhi 2008
5.a. Differentiate between Candidate key and Primary key in context of RDBMS.
Ans. Candidate Key: All attribute combinations inside a relation that can serve primary key are Candidate Keys as they are candidates for the primary key position.
Primary Key: A primary key is a set of one or more attributes that can uniquely identify tuples within the relations.
Outside Delhi 2008
5.a. Differentiate between Candidate Key and alternate Key in context of RDBMS.
Ans. Candidate Key. All attribute combinations inside a relation that can serve as primary key are Candidate Keys as they are candidates for the primary key position.
Alternate Key. A candidate key that is not the primary key is called an Alternate Key.
(Where Candidate Key: All attribute combinations inside a relation that can serve primary key
(uniquely identifies a row in a relation) are Candidate Keys as they are candidates for the primary key position.)
Delhi (2007)
5.a. Differentiate between primary key and alternate key.
Ans: Primary Key: A primary key is a set of one or more attributes that can uniquely identify tuples within the relations. Alternate Key: A candidate key that is not the primary key is called an Alternate Key. (Where Candidate Key: All attribute combinations inside a relation that can serve primary key(uniquely identifies a row in a relation) are Candidate Keys as they are candidates for the primary key position.)
Outside Delhi (2007)
5.a. What is the importance of a primary key in a table? Explain with suitable example.
Ans : Primary Key: A primary key is a set of one or more attributes that can uniquely identify tuples within the relations.
A primary key comprises a single column or set of columns. No two distinct rows in a table can have the same value (or combination of values) in those columns. Depending on its designing, a table may have arbitrarily many candidate keys but at most one primary key. The primary key is non redundant. Ie it does not have duplicate values in the same relation.
Eg: Consider a table consists the following attributes: AdmnNo,FirstName,LastName,SirName,M1,M2,M3,Total,Avg,
FName Here we can uniquely identify the rows in the relation with following key combinations:
(i) AdmnNo
(ii) FirstName,LastName,SirName
(iii) FirstName,LastName,FName , etc.
We can set any one of the above candidate keys as primary key, others are called as alternate keys.