Observe the following table carefully and write the names of the most appropriate columns, which can be considered as

(i) candidate keys and

(ii) primary key

 

Answer:

  • Candidate key refers to the set of all attributes which can uniquely identify tuples in a relation.
  • Primary key refers to a set of one or more attributes which can uniquely identify tuples in a relation. 
  • A table can have only one primary key but a table can have multiple candidate keys.

Example:

Employee_id

Employee_name

Department

Emp_Email

101

Ravi Kumar

Sales

[email protected]

102

Tarun A

IT

[email protected]

103

Jennifer Davis

HR

[email protected]

104

Martin Woods

HR

[email protected]

105

Ron Romy

IT

[email protected]

 

In the EMPLOYEE table given above,

  • Employee_id and Emp_Email are the set of attributes which can uniquely identify the tuples in the table. So, the candidate keys of table EMPLOYEE are Employee_id and Emp_Email.
  • Since a table can have only one primary key, we can select either Employee_id or Emp_Email as the primary key .

In the table given in the question, Id and Product are 2 attributes which can uniquely identify the tuples.

So,

Candidate keys: Id, Product

Primary key: Id

Remove Ads
Teachoo · Class 12 Explore Class 12

Transcript

Observe the following table carefully and write the names of the most appropriate columns, which can be considered as (i) candidate keys and (ii) primary key Answer: Candidate key refers to the set of all attributes which can uniquely identify tuples in a relation. Primary key refers to a set of one or more attributes which can uniquely identify tuples in a relation. A table can have only one primary key but a table can have multiple candidate keys. Example: Employee_id Employee_name Department Emp_Email 101 Ravi Kumar Sales [email protected] 102 Tarun A IT [email protected] 103 Jennifer Davis HR [email protected] 104 Martin Woods HR [email protected] 105 Ron Romy IT [email protected] In the EMPLOYEE table given above, Employee_id and Emp_Email are the set of attributes which can uniquely identify the tuples in the table. So, the candidate keys of table EMPLOYEE are Employee_id and Emp_Email. Since a table can have only one primary key, we can select either Employee_id or Emp_Email as the primary key. In the table given in the question, Id and Product are 2 attributes which can uniquely identify the tuples. So, Candidate keys: Id, Product Primary key: Id

Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.