Question:medium

What is a primary key in a relational database?

Show Hint

When designing a database, choose primary keys that are simple, unique, and stable (like IDs), as they ensure data integrity.
Updated On: Jan 13, 2026
  • A unique identifier for each record in a table
  • A key used for sorting records
  • A key linking two tables
  • A key for encrypting data
Show Solution

The Correct Option is A

Solution and Explanation

A primary key is a cornerstone of relational database design. Key aspects are as follows:
1. Primary Key Definition: - A primary key is a column or a set of columns within a database table that uniquely distinguishes each entry. It enforces that no two records share identical values in the primary key column(s), thereby guaranteeing distinctness.2. Significance: - The primary key serves to ensure that every row in a table is unique and can be referenced distinctly by other tables via foreign keys. This is critical for data integrity and optimizing query performance.3. Incorrect Alternatives: - Option (2) pertains to ordering, but the primary key's function is not record sorting. - Option (3) denotes a foreign key, which establishes relationships between tables, not unique identification within a single table. - Option (4) relates to encryption, which is unrelated to the concept of primary keys.4. Final Determination: - The accurate definition of a primary key is a unique identifier for each record within a table, thus validating option (1).
Was this answer helpful?
0