Skip to content

令和7年度 ITパスポート試験 問66

This question's explanation and your answers so far.

問66
頻出度★★☆

関係データベースで管理している次の“ログイン記録”表及び“部署”表において,ログイン結果が失敗となったことのある,又は,2022年4月10日09:00:00以前にログイン結果が成功となったことのある従業員が所属する部署名だけを全て挙げたものはどれか。 ログイン記録

日時従業員番号部署番号ログイン結果
2022-04-10 08:50:4210004003失敗
2022-04-10 08:53:1510004003成功
2022-04-10 08:55:4810002002成功
2022-04-10 09:00:1510001001成功
2022-04-10 09:01:0510012002成功
2022-04-10 09:03:0110008003成功
2022-04-10 09:10:2810007001成功
2022-04-10 09:32:1910002002成功
2022-04-10 09:39:2210005003失敗
2022-04-10 10:00:0210011001失敗
2022-04-10 10:05:5110011001成功
2022-04-10 10:30:4510009002成功

部署

部署番号部署名
001営業部
002システム部
003人事部
出典 令和7年度 ITパスポート試験 問66
解説

問 66

  • Incorrectア

    “Sales Dept., Systems Dept.” leaves out HR Dept. HR Dept. (003) certainly meets the condition via the failure of 10004 or 10005 and the success of 10004 at 08:53:15, so it cannot be excluded.

  • イ

    正解 The condition is to list all the departments of employees who “have ever failed to log in” OR “have ever logged in successfully before 2022-04-10 09:00:00”. First, looking at employees with a failure record, 10004 (003 HR Dept.), 10005 (003 HR Dept.), and 10011 (001 Sales Dept.) qualify, so Sales Dept. and HR Dept. are included here. Next, looking at successes before 09:00:00, 10004 at 08:53:15 (003 HR Dept.) and 10002 at 08:55:48 (002 Systems Dept.) qualify, so Systems Dept. is added (the success at 09:00:15 is after the reference time, so it is not counted). Combining the two conditions with a logical OR, all three departments — Sales Dept., Systems Dept., and HR Dept. — are present, so the correct answer is “イ”.

  • Incorrectウ

    “Sales Dept., HR Dept.” leaves out Systems Dept. Systems Dept. (002) meets the condition because 10002 logged in successfully at 08:55:48, before 09:00:00, so it must be included.

  • Incorrectエ

    “Systems Dept., HR Dept.” leaves out Sales Dept. Sales Dept. (001) meets the “have ever failed to log in” condition because 10011 failed at 10:00:02, so it must be included.

ここがポイント
  • This problem combines Selection (filtering rows by a condition) with Join (matching department names by department number). Note that for an OR condition, an item qualifies as long as either one of the two conditions is satisfied.
  • When judging a boundary time such as “before 09:00:00”, a success even one second later, like 09:00:15, falls outside the target. The trick is to gather each employee's department into a set without duplicates.
用語

Your answers