ITPEC FE Morning April 2019 Question 26

Source exam: ITPEC FE Morning April 2019Topic: Databases

ITPEC FE Morning April 2019 — Question 26 of 80

SQL MINUS operator — find employees in departments not located in region L2.

Step-by-step:

  • SELECT DNO FROM DEPT{1, 2, 3}
  • SELECT DNO FROM DEPT_LOCS WHERE Region='L2'{2, 3}
  • MINUS: {1, 2, 3} - {2, 3} = {1}
  • Final query selects employees where DNO IN (1)

Result: John Bate (20000), Sadat Hossain (50000) → (b)

Why not others:
- (a) NULL/NULL — MINUS does not produce an empty set here; DNO 1 remains

- (c) 4 rows — would require DNO IN (1, 3), but DNO 3 is removed by MINUS

- (d) 5 rows — would mean no filtering at all

Key rule: MINUS (called EXCEPT in standard SQL) returns rows from the first query that do not appear in the second query.

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 FE past-paper collection or Report an issue.