Skip to content
Question

Q.Explain the concept of "Alternate Key" in a Relational Database Management System with an appropriate example.

CBSECBSE Class XII Board 2023Subjective· 2mImportance★★★★★
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

An Alternate Key is any candidate key that is not chosen as the Primary Key — it is a valid, unique identifier for a record that you set aside in favour of another.

In a relational database, every table needs a way to uniquely identify each row. The set of all possible columns (or combinations of columns) that can do this job are called candidate keys. Think of them as the shortlisted candidates for the role of "official identifier." From this shortlist, you pick one to be the Primary Key — the main, non-null, never-changing identifier you will use most often. The remaining candidate keys, the ones that were not selected, become Alternate Keys.

Why would you have more than one candidate? Because real-world data often has multiple natural unique identifiers. For a student table, the Roll Number is unique, but so is the Aadhaar Number, and so is the Email ID (if the school enforces unique emails). Each of these could serve as the primary key. You choose one — say, Roll Number — and the others (Aadhaar Number, Email ID) become alternate keys.

Note

Alternate keys are not "second-class" keys. They still enforce uniqueness — the database will reject duplicate Aadhaar numbers even though Aadhaar is not the primary key. They are simply the keys that did not win the primary-key election.

The practical value of alternate keys is that they prevent data corruption. Without an alternate key constraint on Email ID, you could accidentally enter two students with the same email address, which would break any system that relies on email for login or communication. By declaring Email ID as an alternate key, you tell the database: "This column must also be unique, even though I am not using it as the main identifier."

Important

An alternate key must satisfy all the properties of a candidate key: it must be unique (no two rows share the same value) and irreducible (no unnecessary columns in a composite key). It is simply a candidate key that was not promoted to primary key. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.