How many primary keys can be there in a table?
2023
How many primary keys can be there in a table?
- A.
Only 1
- B.
Only 2
- C.
Depends on number of columns
- D.
More than one of the above
- E.
None of the above
Attempted by 3172 students.
Show answer & explanation
Correct answer: A
In a relational database, a primary key is a column or set of columns that uniquely identifies each row in a table. A table can have only one primary key constraint, even if it consists of multiple columns (known as a composite primary key). This ensures data integrity and prevents duplicate rows. Therefore, the correct answer is that only one primary key can exist in a table.