P 社は,セキュリティを確保するために自社ビルを 10 の区画に分け,各区画への入退室を IC カードで行うシステムを導入し,その管理方法についての検証を始めた。この IC カードを使った入退室管理(以下,入退室管理という)の概要は次のとおりであり,入退室管理で用いるデータベースの構造(一部)を図 1 に示す。 〔入退室管理の概要〕 (1) 社員は一つの部署に所属し,IC カードを 1 人 1 枚貸与される。IC カードはカード固有の IC カード番号をもつ。IC カードの情報は IC カード登録表に登録される。 (2) 社員の入退室が許可されている区画は個別に決められており,許可された区分の情報が入退室許可表に登録される。入退室が可能な場合で,その区画が所属部署の入っている区画の場合は “1”,それ以外で入退室が必要と認められた区画の場合は “2” が,入退室許可表の許可区分に登録される。 (3) 各区画には IC カードリーダが設置されており,入退室が許可された IC カード番号を読み取ったときだけドアを解錠し,入退室の記録を入退室記録表に記録する。このとき,入室の場合は “1”,退室の場合は “−1” を入退室記録表の入退室区分に記録する。 なお,P 社は,社員に対して午前 0 時までに退社することを義務づけている。 ICカードリーダでICカード番号を読み込んだときに,入室の可否を判断するためには,データベース中の幾つかの表を調べる必要がある。調べる表とその順番として,適切なものはどれか。ここで,→は表を参照する順番を示している。 なお,社員は1人ずつICカードを使って入退室することになっている。
平成27年度 春期 ITパスポート試験 問85
This question's explanation and your answers so far.
問 85
- ア
正解 All the IC card reader can obtain is the “IC card number”, and the number itself does not show whose card it is. So you first reference the “IC card registration table” to identify the owner (employee number) from the card number. Next, using that employee number as the key, you reference the “Entry/exit permission table” to check whether that employee has permission to enter this room. Only after these two stages can entry be judged, so the order is “IC card registration table → Entry/exit permission table”, and ア is correct. Tracing the keys — card number → employee number → permission or not — is exactly the order in which the tables are referenced.
Incorrectイ
The “Entry/exit record table” is inserted in the middle of the order. The record table is a history table that keeps “who entered or exited where, and when”; it does not hold the information (authorization) that decides entry itself. The question also states that each employee enters and exits using his or her own IC card, so there is no need to check past records for things like tailgating detection either. This reference is therefore unnecessary.
Incorrectウ
It starts by looking at the “Entry/exit record table”. At the moment of reading, the only thing known is the IC card number, and what is needed to judge entry is identifying the owner and confirming authorization. Starting from the record table, which is only a history, leads neither to identifying the employee nor to confirming authorization, so it is wrong as the starting point of the references.
Incorrectエ
Because the “IC card registration table” is not referenced, the step of identifying the employee from the IC card number is missing. If the employee cannot be identified, there is no key with which to look up the “Entry/exit permission table”, so permission cannot be judged at all.
- In a relational database, you start from the key you have at hand (here the IC card number) and reach the target information (entry permission) by referencing (joining and selecting) tables one after another. The order of reference is determined as: input key → the table that maps it to something else → the table that provides the basis for the decision.
- Tell the roles of tables apart: a registration (master) table defines correspondences, a permission table provides the material for judging authorization, and a record (history) table is for after-the-fact logging and tracking — it is not used as input for deciding whether entry is allowed.