ITPEC IP April 2023 Question 28

Topic: DatabasesAlso asked in April 2019

Which of the following is a term for an operation that extracts only the rows (records) with a price of 100 yen or more, from the “Product” table of a relational database?

Product

Product_numberProduct_namePrice (yen)
S001Scissors200
S002Pencil50
S003Notebook120
S004Eraser80
S005Ruler150

Explanation

Selection — the relational operation that extracts the rows satisfying a condition, here a price of 100 yen or more.

Applying the condition to the Product table keeps three of the five rows, with every column:

Product_numberProduct_namePrice (yen)
S001Scissors200
S003Notebook120
S005Ruler150

Pencil (50) and Eraser (80) fall below 100 and are dropped.

Answer (c)

Why not others:

  • •(a) Join — combines two tables into one by matching a common column; only one table is involved here
  • •(b) Projection — extracts columns, for example only Product_name and Price, and keeps every row
  • •(d) Union — combines the rows of two tables with the same structure into one table

Key rule: Selection cuts a table horizontally (rows), projection vertically (columns); join puts tables side by side, union stacks tables of the same structure.

Databases · AI-written, may contain errors

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official IP past-paper collection or Report an issue.