explain the terms primary key candidate key


Explain the terms primary key, candidate key, alternate key and secondary key. In the given table identify every key?

STUDENT(SID,Regno, Name, City)

Primary Key: The primary key of a relational table uniquely identify every record in the table. It can either be a general attribute (or set of attributes) which is guaranteed to be unique (such as Social Security Number in a table along with no more than one record per person) or it could be provided through the DBMS (such as a globally unique identifier, or GUID, in Microsoft SQL Server).

Candidate Key: A candidate key is a combination of attributes in which can be uniquely used to recognize a database record without any extraneous data. Each table may have one or more candidate keys. One of these candidate keys is chosen as the table primary key.

Alternate Key: An alternate key (or secondary key) is any candidate key that is not selected to be the primary key (PK).

For instance, a relational database along with a table "employee" could have attributes like

"employee_id", "bank_acct_no", and so on. In this case, both "employee_id" and
"bank_acct_no" serve as unique identifiers for a given employee, and could therefore arguably be used for a primary key. Therefore, both of them are known as "candidate keys". If, for example, "bank_acct_no" was chosen as the primary key, "employee_id" would become the alternate key

Secondary Key: Same as above

In above table SID is a primary key, SID and Regno are candidate keys and SIDor Regno are alternate or secondary key.

Request for Solution File

Ask an Expert for Answer!!
Database Management System: explain the terms primary key candidate key
Reference No:- TGS0283342

Expected delivery within 24 Hours