Skip to content

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

This question's explanation and your answers so far.

問99
頻出度★★☆

広告代理店の A 社では,申請者が経理部に回付した交通費精算伝票(以下,伝票という)を使って,顧客訪問時に発生した交通費の精算業務を行っている。 〔現在の交通費精算業務の流れ〕 (1)申請者は,伝票に申請者名,社員番号,経費科目,顧客番号,利用日,利用区間,金額及び合計金額を記入する。押印後,事務担当者に回付する。 (2)事務担当者は,申請内容を精査し,誤りがなければ伝票を承認者に回付する。誤りがあれば,伝票を申請者に差し戻す。 (3)承認者は,承認又は否認の決裁を行う。内容が適切であった場合には承認して,事務担当者に回付する。内容が適切でなければ否認して,申請者に差し戻す。 (4)(2)又は(3)で差し戻された場合,申請者は伝票を修正し,再度事務担当者に回付する。 (5)事務担当者は,承認者から回付された当日分の承認済み伝票を取りまとめ,伝票番号を採番し,経理部に回付する。 (6)経理担当者は,事務担当者から回付されてきた承認済み伝票の支払処理を行う。 交通費精算を効率よく行うために,データベースを活用して,次に示す機能要件の交通費精算システム(以下,精算システムという)を構築することにした。 〔精算システムの機能要件の一部〕 (1)社員番号でログオンする。社員番号によって,社員表から申請者名を抽出し,申請画面の共通項目として設定する。 (2)申請画面の明細として,顧客番号,利用日,利用区間と金額を入力する。1回の申請で複数の顧客訪問に対する明細が入力できる。また,合計金額の算出,経費科目の設定及び伝票番号の自動採番を行う。ここで経費科目として,交通費を自動設定する。 (3)申請後,事務担当者が精査を行い,自動的に承認者に通知が行く。承認者は決裁画面で承認か否認かを選択する。 (4)支払画面で承認済み申請を社員ごとに集計し,支払金額を算出する。 精算システムのデータベースを使って,図1に示す顧客別社員別交通費実績表(以下,実績表という)を作成することにした。実績表を作成する手順として,dに入れる適切なものはどれか。ここで,実績表に出力する伝票は,申請日が前月であり,かつ,承認区分が“承認”のものとする。 また,精算システムで利用される表は図2のとおりである。 〔実績表の作成手順〕 (1)精算表から,申請日が前月かつ承認区分が“承認”のデータを抽出する。 [ d ] (4)(3)の表と社員表と顧客表を結合して,顧客名と社員名を取得する。 図1 顧客別社員別交通費実績表の例

顧客番号顧客名社員番号社員名金額
000100B商事2005123田中太郎2,500
000100B商事2006211鈴木太郎4,300

図2 精算システムで利用される表 精算表

伝票番号申請日社員番号承認区分

明細表

伝票番号明細番号顧客番号利用日利用区間金額

社員表

社員番号社員名

顧客表

顧客番号顧客名住所電話番号

注記 主キーは表示していない。

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

問 99

  • ア

    正解 What we need is the “customer-by-employee” transportation expense report in Figure 1, that is, a table with one row per combination of a customer and an employee, where the amount is the total for that combination. First, use Figure 2 to check which table holds each required column. The amount and the customer number exist only in the detail table, and the employee number exists only in the settlement table. In other words, looking at only one of these tables cannot tell you “which customer, which employee, and how much was spent”. So in (2), the settlement table narrowed down in step (1) (applied in the previous month and approved) is joined with the detail table on the slip number, the column common to both tables. Now a single row contains the employee number, the customer number, and the amount together. Next, in (3), the joined result is aggregated by identical customer number and employee number to total the amounts, producing a table of customer number, employee number, and total amount. This is exactly the granularity of Figure 1. Finally, in (4), joining this table with the employee table and the customer table adds the names, the employee name and the customer name, and Figure 1 is complete. The decisive point is that (4) states “obtain the customer name and the employee name”: unless both the customer number and the employee number remain in the table from (3), the names cannot be looked up. Only ア satisfies this condition.

  • Incorrectイ

    The join in (2) is correct, but (3) uses only the customer number as the aggregation key, so the employee number disappears during aggregation. The result is a “by customer” total table with no breakdown by employee. Even if you tried to join with the employee table in step (4) to obtain the employee name, it cannot be done because the employee number that would serve as the join key no longer remains, and you also cannot produce the form in Figure 1 where the same customer 000100 is split into two rows by employee.

  • Incorrectウ

    The opposite of イ: (3) uses only the employee number as the aggregation key, so the customer number is lost. The result is a “by employee” total table with no breakdown by customer. In step (4) you cannot join with the customer table to obtain the customer name, and it does not satisfy the required “customer-by-employee” aggregation granularity.

  • Incorrectエ

    The procedure breaks down in two ways. First, (2) tries to aggregate by the combination of customer number and employee number using only the detail table, but as Figure 2 shows, the detail table has no employee number column, so this aggregation itself is impossible. Second, even supposing it could be done, aggregation removes the slip number from the table, so joining with the table from (1) on the slip number in (3) is also impossible. In addition, aggregating first and only then narrowing down to the previous month and approved slips would mix the amounts of out-of-scope slips into the totals.

ここがポイント
  • Using the basic relational database operations, join, selection, and projection, in the right way. To bring columns spread across several tables into a single row, a join on a common column (here, the slip number) is required, and aggregation comes after that join.
  • The aggregation (grouping) key must match the granularity of the table you finally want to output. For “customer-by-employee”, the key is the combination of customer number and employee number; any column not included in the aggregation key is lost from the table and can no longer be used for subsequent joins.
用語

Your answers