Skip to content

令和元年度 秋期 ITパスポート試験 問66

This question's explanation and your answers so far.

問66
頻出度★★★

関係データベースにおいて, 主キーを設定する理由はどれか。

出典 令和元年度 秋期 ITパスポート試験 問66
解説

問 66

  • Incorrectア

    The purpose of setting a primary key is to uniquely identify records, which has nothing to do with whether that column becomes subject to arithmetic operations. If the primary key is a numeric column, the operations themselves are still possible; setting a primary key does not make the column exempt from operations.

  • Incorrectイ

    Searching can be done using any column as a condition even without setting a primary key (whether searching is possible does not depend on the presence of a primary key). The explanation that a column becomes searchable because a primary key was set is wrong.

  • Incorrectウ

    On the contrary, a primary key is the base column that other tables reference through a foreign key; it is not something that “prevents” references from other tables. This explanation is the opposite of the actual role of a primary key.

  • エ

    正解 A primary key is set in a table of a relational database in order to uniquely identify each record (row). The value of the column (or the combination of multiple columns) designated as the primary key is not duplicated within the table, and a null value (NULL) is not allowed either. Therefore, once the value of the primary key is known, the target record can be pinned down to exactly one. Hence choice エ, which states that it “makes it possible to uniquely identify records in the table,” is correct.

ここがポイント
  • A primary key is a column, or a set of columns, that uniquely identifies each record (row) in a table; it allows neither duplicate values nor null values (NULL).
  • The purpose of setting a primary key is to uniquely identify records; this is a separate concept from searchability, being subject to operations, or preventing references.
用語

Your answers