Question:

Define Primary Key?

Show Hint

Primary keys are essential for maintaining data integrity and establishing relationships between different tables in a relational database.
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Primary Key:  

A Primary Key is a field (or column) in a database table that uniquely identifies each record (row) in that table. It must contain unique values and cannot contain NULL values

Key Characteristics:

  • Uniqueness: Each primary key value must be unique across all records in the table.
  • Non-null: A primary key cannot contain empty or NULL values.
  • Unchanging: Primary key values should rarely, if ever, change.
  • Single per table: Each table can have only one primary key.


Example: 

In a Students table, Student_ID can serve as the primary key because each student has a unique ID. 

 

Student_ID (Primary Key)NameAgeGrade
101Alice1510
102Bob1611
103Charlie1510



Final Answer: 

\[ \boxed{\text{A primary key is a unique identifier for each record in a database table.}} \]

Was this answer helpful?
0
0