IPA IP 2026 Question 72

Topic: Databases

A question IPA Japan published in 令和8年度 ITパスポート試験 公開問題 問72, translated into English. ITPEC is based on the same exams.

There are “Account”, “Customer” and “TransactionDetail” tables that are managed in a relational database. When a new customer deposits 10,000 yen at the same time as opening an account, which of the following is the appropriate order in which data is added to the tables? Here, of the underlines, a solid line represents a primary key, and a dashed line represents a foreign key.

Account
AccountNumberAccountTypeBalanceCustomerNumber
Customer
CustomerNumberCustomerName
TransactionDetail
TransactionNumberTransactionDateTimeTransactionTypeTransactionAmountAccountNumber

Explanation

Customer → Account → TransactionDetail — a row that holds a foreign key can be added only after the row it refers to exists.

The foreign keys set the order:

  • •CustomerNumber in “Account” refers to “Customer”, so the new customer’s row must be added to “Customer” before the account row
  • •AccountNumber in “TransactionDetail” refers to “Account”, so the account must exist before the 10,000-yen deposit is recorded as a transaction

“Customer” has no foreign key, so it comes first. Referential integrity would reject an account whose customer number is not yet in “Customer”, or a transaction whose account number is not yet in “Account”.

Answer (b)

Why not others:

  • •(a) — adds the account first, but its CustomerNumber would refer to a customer not yet in “Customer”
  • •(c) — records the deposit before the account exists, so its AccountNumber refers to nothing
  • •(d) — the reverse of the right order: the transaction and the account would each refer to a row not yet added

Key rule: Insert the referenced (parent) row before the row whose foreign key points to it; delete in the reverse order.

Databases · AI-written, may contain errors

This question comes from the past questions IPA Japan publishes, translated into English by ITPEC Practice. ITPEC Practice is an independent study tool and is not affiliated with IPA or ITPEC. See the original paper (PDF) or Report an issue.