表1と表2に,ある操作を行って表3が得られた。行った操作だけを全て挙げたものはどれか。 表1
| 品名コード | 品名 | 価格 | メーカ |
|---|---|---|---|
| 001 | ラーメン | 150 | A社 |
| 002 | うどん | 130 | B社 |
表2
| 品名コード | 棚番号 |
|---|---|
| 001 | 1 |
| 002 | 5 |
表3
| 品名 | 価格 | 棚番号 |
|---|---|---|
| ラーメン | 150 | 1 |
| うどん | 130 | 5 |
This question's explanation and your answers so far.
表1と表2に,ある操作を行って表3が得られた。行った操作だけを全て挙げたものはどれか。 表1
| 品名コード | 品名 | 価格 | メーカ |
|---|---|---|---|
| 001 | ラーメン | 150 | A社 |
| 002 | うどん | 130 | B社 |
表2
| 品名コード | 棚番号 |
|---|---|
| 001 | 1 |
| 002 | 5 |
表3
| 品名 | 価格 | 棚番号 |
|---|---|---|
| ラーメン | 150 | 1 |
| うどん | 130 | 5 |
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.
“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.
“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.