Skip to content

平成21年度 秋期 ITパスポート試験 問100

This question's explanation and your answers so far.

問100
頻出度★★★

I社は,企業に対してPC関連機器の販売を行っており,販売管理業務の情報をデータベースによって管理している。図1に示すデータベースとデータベース管理システムの印刷機能を使って,販売時に図2の請求書を発行する。 各商品の販売単価は適宜変更され,新たな販売単価とその更新日時が販売単価表の該当レコードに上書きされる。また,取引を行う企業(以下,取引先という)の担当者は原則1人であるが,取引先によっては部署ごとに1人存在することがある。取引先コードは,取引先ごとに採番する。 **図1 販売管理業務に関するデータベースの構造** 商品表

商品コード商品名分類コードメーカコード仕入先コード

販売単価表

商品コード販売単価更新日時

取引先表

取引先コード取引先名

取引先担当者表

取引先コード部署名所在地名前役職電話番号

**図2 請求書の様式** - 表題: 請求書 - 右上: 平成YY年MM月DD日 - 宛先欄 (左側): - [取引先名] [部署名] - [役職] [名前]様 - [所在地] [電話番号] - 本文: 下記のとおりご請求申し上げます。 - 発行者欄 (右側): 東京都文京区本駒込×丁目××番×号/株式会社 I - 右側: 伝票番号 XXXXXXXXXX - 明細表 (見出し行のみ。データ行は空欄):

商品コード商品名数量単価金額

- 合計欄 (明細表の下部。「合計」の行に「税抜」「消費税」「総額」の見出しがあり,その下の値セルは空欄):

合計税抜消費税総額

図2の請求書を表として記録することになった。請求書の表を作成するに当たり,伝票番号,日付,取引先コード,部署名,商品コード,数量,単価の七つの項目を記録することにした。これらの項目を正規化して記録するとき,表の構成として適切なものはどれか。

  • 1つの表
    伝票番号日付取引先コード部署名商品コード数量単価
  • 表1
    伝票番号日付取引先コード部署名/ 表2:商品コード数量単価
  • 表1
    伝票番号日付取引先コード部署名/ 表2:伝票番号商品コード数量単価
  • 表1
    伝票番号日付/ 表2:取引先コード部署名/ 表3:商品コード数量単価
出典 平成21年度 秋期 ITパスポート試験 問100
解説

問 100

  • Incorrectア

    It puts all seven data items into a single table. For an invoice with several line items, the same slip number, date, business partner code and department name must be stored again for every row. The repeating items are not separated out, so the data is not normalized, and it invites inconsistency when data is updated (update anomalies).

  • Incorrectイ

    Separating out the line-item part is fine, but the line-item table [product code, quantity, unit price] has no slip number, so there is no way to tell which line item belongs to which slip. The tables cannot be joined back into the original invoice, so this way of splitting is inappropriate.

  • ウ

    正解 One invoice mixes two kinds of data items: slip number, date, business partner code and department name are items that take exactly one value per invoice, while product code, quantity and unit price repeat once for every line item. The first step of normalization is to separate this repeating part into another table (first normal form). Choice ウ splits the data into a slip header table [slip number, date, business partner code, department name] and a line-item table [slip number, product code, quantity, unit price]. Because the line-item table carries the slip number, you can tell which slip each line belongs to; the primary key of the line-item table is [slip number + product code], and the slip number works as a foreign key pointing to the slip header table. Even after the split the original invoice can be reconstructed, and the date and business partner code are no longer recorded redundantly, so ウ is appropriate.

  • Incorrectエ

    It splits the data into three tables — slip number with date, business partner code with department name, and the line items — but none of the tables has enough keys to link it to the others. You cannot tell which slip the business partner code and department name belong to, nor which slip the line items belong to, so again the original invoice cannot be reconstructed. This is an example of splitting too far and cutting the relationships.

ここがポイント
  • The first step of normalization is to move the repeating items (the line items) into a separate table. Splitting a slip into a header part and a line-item part is the basic pattern.
  • Once you split a table, always keep in the separated table an item that points back to the original table (a foreign key, here the slip number). Without it the tables cannot be joined and the original data cannot be reconstructed.
用語
解答問100ウ
Practise this question

Your answers