IPA IP 2022 Question 98

Topic: Databases

A question IPA Japan published in 令和4年度 ITパスポート試験 公開問題 問98, translated into English. ITPEC is based on the same exams.

Which of the following is the term for the operation that extracts only the Name column from the “Employee” table managed in a relational database?

Employee

Employee numberNameDepartment code
H001Shiken HanakoG02
H002Joho TaroG01
H003Kodo JiroG03
H004Gozen SakurakoG03
H005Gogo SaburoG02

Explanation

Projection — taking out particular columns (fields) of a table is projection.

The operation keeps all five rows but only the Name column, giving a one-column table: Shiken Hanako, Joho Taro, Kodo Jiro, Gozen Sakurako, Gogo Saburo. In SQL it is the list of columns after SELECT, as in SELECT Name FROM Employee.

Answer (b)

Why not others:

  • •(a) — a join combines two tables into one by matching the values of a common column, for example Employee and a department table on the department code
  • •(c) — selection takes out the rows (records) that meet a condition, such as the employees with department code G03
  • •(d) — union is a set operation that puts together the rows of two tables of the same layout

Key rule: Projection takes columns, selection takes rows, join links tables through a common column; union, intersection and difference combine tables of the same layout.

Databases · AI-written, may contain errors

This question comes from the past questions IPA Japan publishes, translated into English by ITPEC Practice. ITPEC Practice is an independent study tool and is not affiliated with IPA or ITPEC. See the original paper (PDF) or Report an issue.