Skip to content

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

This question's explanation and your answers so far.

問99
頻出度★★★

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

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

販売単価表

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

取引先表

取引先コード取引先名

取引先担当者表

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

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

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

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

合計税抜消費税総額

図2の請求書を発行するのに図1の4種類の表を参照する必要がある。1枚の請求書を発行するとき,4種類のレコードのそれぞれを参照する回数の大小関係を示したものはどれか。なお,請求書の発行作業の時点で,取引先コード,名前,部署名,購入した商品ごとの商品コードと数量が分かっており,これらの値を使って各表を参照する。参照では,主キーによって一つのレコードを取り出す操作を1回と数える。また,「商品表>販売単価表」という記述は,商品表の方が販売単価表より表の参照回数が多いことを示している。

出典 平成21年度 秋期 ITパスポート試験 問99
解説

問 99

  • Incorrectア

    This option joins every table with equals signs, but when the line-item table has several rows (two or more kinds of products purchased), the reference count n for the Product table and the Unit price table is greater than the single reference to the Business partner table and the Business partner contact person table. The line-item table in Figure 2 is laid out for multiple rows, so the counts are not always equal.

  • イ

    正解 Count, table by table, how many references are needed to issue one invoice. The business partner name in the addressee block is obtained by looking up the Business partner table once by the business partner code (the primary key). The address, job title, and phone number are obtained by looking up the Business partner contact person table once by (business partner code + department name). There is in principle one contact person per business partner, or one per department, so a single invoice involves only one contact record. On the other hand, the line-item table has as many rows as the kinds of products purchased; letting that count be n, the Product table is referenced n times to get the product names and the Unit price table n times to get the unit prices. Therefore Unit price table = Product table = n, and Business partner contact person table = Business partner table = 1; since at least one kind of product is purchased, n ≧ 1. Putting this together gives Unit price table = Product table ≧ Business partner contact person table = Business partner table, so イ is correct.

  • Incorrectウ

    This option states Unit price table ≧ Product table, but the product name comes from the Product table and the unit price from the Unit price table, each looked up once per line item, so the two counts are always the same (both n). Leaving room for a difference makes this an inaccurate statement of the relationship that must always hold.

  • Incorrectエ

    Besides the inaccurate Unit price table ≧ Product table, stating Business partner contact person table ≧ Business partner table is also wrong. The business partner name is looked up once in the Business partner table and the contact information once in the Business partner contact person table; one invoice has a single addressee, so the two counts are necessarily equal.

ここがポイント
  • When retrieving one record by its primary key counts as one reference, the number of references is determined by how many items of that table's information the invoice needs. The addressee-related tables (Business partner table, Business partner contact person table) supply one item per invoice, while the line-item-related tables (Product table, Unit price table) supply n items, the number of products.
  • In a normalized database, producing one business form requires joining and referencing several tables by their primary keys. The key point is to map each item to the table that holds it: product name = Product table, unit price = Unit price table, business partner name = Business partner table, address / job title / phone number = Business partner contact person table.
用語

Your answers