Skip to content

平成28年度 春期 ITパスポート試験 問95

This question's explanation and your answers so far.

問95
頻出度★★☆

表1と表2に,ある操作を行って表3が得られた。行った操作だけを全て挙げたものはどれか。 表1

品名コード品名価格メーカ
001ラーメン150A社
002うどん130B社

表2

品名コード棚番号
0011
0025

表3

品名価格棚番号
ラーメン1501
うどん1305
出典 平成28年度 春期 ITパスポート試験 問95
解説

問 95

  • Incorrectア

    With only “Join”, at the stage where Table 1 and Table 2 are joined, five columns including “Item code” and “Manufacturer” remain, so you cannot obtain Table 3 with only three columns. You also need “Projection” to drop the unnecessary columns, so the operations are insufficient.

  • イ

    正解 Building Table 3 requires two steps. First, using the column “Item code” that Table 1 and Table 2 have in common as the key, the operation that joins the two tables side by side and combines them into a single table is “Join”. After the join, all five columns “Item code, Item name, Price, Manufacturer, Shelf number” are present. Next, the operation that takes out only the three columns kept in Table 3, namely “Item name, Price, Shelf number”, and drops the “Item code” and “Manufacturer” columns is “Projection”. As for the rows, both records, Ramen and Udon, remain unchanged, so no narrowing of rows (Selection) was performed. Therefore the operations performed are the two, “Join” and “Projection”, so イ is correct.

  • Incorrectウ

    “Selection” is the operation that takes out only the rows meeting a condition, but in Table 3 both the Ramen and Udon rows remain unchanged, so no narrowing of rows was performed. Also, “Projection”, which reduces columns, is not listed, so this does not match the operations actually performed.

  • Incorrectエ

    “Shelf number” is a column in Table 2, while “Item name” and “Price” are columns in Table 1, so unless you perform “Join” to combine the two tables into one, you cannot obtain the form of Table 3. It lacks the join, and it also wrongly includes “Selection”, which was not performed.

ここがポイント
  • Distinguishing the basic relational-database operations: “Join” connects multiple tables into one using a shared column as the key; “Projection” takes out only the needed columns (narrowing vertically); “Selection” takes out only the rows meeting a condition (narrowing horizontally).
  • The point of this question is to discern, from both the columns and the rows of Table 3, that Table 1 and Table 2 are joined on the item code and the needed three columns are taken out by “Projection”, while no narrowing of rows (Selection) is performed.
用語

Your answers