Skip to content

平成22年度 春期 ITパスポート試験 問96

This question's explanation and your answers so far.

問96
頻出度★★☆

A社研究所の資料室では,文献の貸出管理業務を行っている。文献の貸出管理業務には,PCのデータベースソフトを活用した文献貸出管理システム(以下,文献システムという)を利用している。 文献システムのデータベース構造は,次のとおりである。 社員表

社員番号社員名メールアドレス

文献表

文献番号文献名

貸出表

文献番号文献名社員番号社員名メールアドレス貸出日返却日

保有する文献と貸出についての条件は,次のとおりである。 〔保有する文献と貸出についての条件〕 (1) 同一文献は複数保有せず,文献ごとに固有な文献番号が採番されている。 (2) 貸出期間は,貸出日を含んで最長2週間である。ここで,返却された文献をその日に違う社員に貸し出すことは可能であるが,同じ社員に対して返却した同一文献をその日のうちに貸し出すことはない。 貸出から返却までの手続は,次のとおりである。 〔貸出から返却までの手続〕 (1) 社員は借りたい文献を書庫から取り出して,資料室の担当者(以下,担当者という)に手渡し,社員番号を提示する。 (2) 担当者は文献システムを使って貸出処理を行い,社員に文献を手渡す。 (3) 文献返却時,社員は担当者に文献を返却し,担当者は文献システムを使って返却処理を行う。 文献システムにおける貸出処理と返却処理の仕様は,次のとおりである。 〔貸出処理〕 (1) 文献番号で文献表を検索し,文献名を取得する。 (2) 社員番号で社員表を検索し,社員名とメールアドレスを取得する。 (3) 貸出表のレコード(以下,貸出レコードという)を用意して,(1),(2)で取得した文献番号,文献名,社員番号,社員名,メールアドレスを設定し,貸出日に当日の日付を,返却日に空白値を設定する。 (4) (3)で設定した貸出レコードを貸出表に追加する。 〔返却処理〕 (1) 文献番号で貸出表を検索し,返却日が空白値である貸出レコードを抽出する。 (2) 抽出した貸出レコードの返却日に当日の日付を設定し,貸出表を更新する。 貸出日を含んで 2 週間を超えても返却していない社員に対して, 連絡するために調査を行った。該当者を抽出する方法として, 適切なものはどれか。

出典 平成22年度 春期 ITパスポート試験 問96
解説

問 96

  • Incorrectア

    The fields used in the conditions are swapped. The lending date is always recorded when an item is lent out, so it never becomes null, and this condition would extract almost nothing. Furthermore, “the return date is within 2 weeks from the investigation date” is a condition that picks records that already have a return date, that is, ones already returned, which is the opposite direction from the goal of finding people who have not returned anything.

  • Incorrectイ

    It has only the deadline condition “the lending date is 2 or more weeks before the investigation date” and does not ask whether the item is still unreturned. As a result, records of employees who borrowed more than 2 weeks ago but have already properly returned the item are also included, so even people who should not be contacted get extracted.

  • ウ

    正解 What we want is employees who have not returned the item yet and whose loan has also gone past 2 weeks, so two extraction conditions are needed. The first is that the item is not returned. In the lending table, a date is set in the return date when the return is processed, so a record whose return date is still null is one that has not come back yet. The second is that the deadline has passed. Being more than 2 weeks counting from the lending date inclusive means that the lending date is 2 or more weeks before the investigation date. Choice ウ joins these two with “and”, extracting records where the return date is null and the lending date is 2 or more weeks before the investigation date, so it picks out exactly the applicable people, no more and no less. This is a typical example of what a relational database calls “selection” (the operation of narrowing down to only the rows that meet a condition), carried out with multiple conditions combined by AND.

  • Incorrectエ

    “The return date is null” is correct as a condition for not yet returned, but the deadline condition is missing. An employee who borrowed only yesterday and is still within the return period is also unreturned, so they too would enter the extraction results, and it cannot narrow the list down to only those who have gone past 2 weeks.

ここがポイント
  • When designing extraction (selection) conditions, translate the requirement given in words into conditions on fields one by one and count them up. “Not returned yet” = the return date is null; “more than 2 weeks counting from the lending date inclusive” = the lending date is 2 or more weeks before the investigation date; then join the two with “and” (AND).
  • If one condition is missing, unnecessary records get mixed into the result, and if the field used in a condition is mistaken, the needed records cannot be obtained. Also keep in mind that a null value (a state where no value has been set) is used as a mark showing that the corresponding processing has not been done yet.
用語

Your answers