Question:

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: Jun 23, 2025
  • 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
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

A primary key is a fundamental concept in relational database design. Let’s break down the details:
1. Definition of Primary Key: - A primary key is a field (or a combination of fields) in a database table that uniquely identifies each record in that table. It ensures that no two records can have the same value in the primary key field(s), thus guaranteeing uniqueness. 2. Importance: - The primary key is used to ensure that each row in a table is distinct and can be uniquely referenced by other tables through foreign keys. This is essential for maintaining data integrity and supporting efficient queries. 3. Incorrect Options: - Option (2) refers to sorting, but the primary key is not used for sorting records. - Option (3) refers to a foreign key, which is used for linking tables, not for identifying records uniquely in a single table. - Option (4) refers to encryption, which is unrelated to primary keys. 4. Conclusion: - The correct definition of a primary key is a unique identifier for each record in a table, making option (1) correct.
Was this answer helpful?
0
0