ITPEC IP April 2022 Question 27

Source exam: ITPEC IP April 2022Topic: Databases

ITPEC IP April 2022 — Question 27 of 100

Two employees live in a prefecture different from their department's prefecture. Join each employee to Department using Department_code. H002 belongs to G01 in Tokyo but lives in Kanagawa, and H003 belongs to G03 in Aichi but lives in Mie, so both qualify. H001 and H006 match G02's Kanagawa, H004 matches G04's Osaka, and H005 matches G03's Aichi.

Answer (b)

Why not others:
- 1 overlooks one of H002 and H003

- 3 or 4 incorrectly counts employees whose prefecture equals their department's prefecture

Key rule: First join rows on the common department code, then compare the two prefecture fields and count only unequal pairs.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

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.