ITPEC IP April 2022 Question 29
In a relational database, which of the following is the reason for a primary key being specified?
Explanation
To enable any record in the table to be uniquely identified — the purpose of a primary key.
A primary key is a column, or a set of columns, whose value differs in every row and is never NULL. Given a key value, exactly one record is found, and other tables can point to that record with a foreign key holding the same value.
Answer (d)
Why not others:
- •(a) — whether a column takes part in arithmetic depends on its data type and meaning; being a key says nothing about it
- •(b) — any column can be searched with a condition in a query; a primary key is not needed for that (an index speeds searching, and one is usually built on the key, but that is not its purpose)
- •(c) — the opposite: the primary key is exactly what other tables reference, through foreign keys
Key rule: A primary key is unique and not NULL and identifies one row; a foreign key refers to a primary key in another table, and its values may repeat.
Databases · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.