ITPEC FE Morning April 2023 Question 26

Source exam: ITPEC FE Morning April 2023Topic: Databases

ITPEC FE Morning April 2023 — Question 26 of 80

Candidate Key from Functional Dependencies — find the minimal set of attributes that determines all others.

Given R = (M, N, O, P, S, T) with FDs:
- O → T

- S → M

- OS → P

- M → N

Step 1: Find attributes that never appear on the right side of any FD.

Right-side attributes: T, M, P, N
Never on right side: `O` and `S` → must be part of every key.

Step 2: Compute closure of `{O, S}`:
- Start: {O, S}

- O → T{O, S, T}

- S → M{O, S, T, M}

- OS → P{O, S, T, M, P}

- M → N{O, S, T, M, P, N} = all attributes ✓

OS is a superkey, and neither O alone nor S alone determines all attributes → OS is minimal → it is a candidate key.

Why not others:
- (a) MO — cannot derive S, so cannot derive P via OS → P

- (b) MS — cannot derive O, so cannot derive T via O → T

- (c) OP — cannot derive S, so cannot derive M via S → M

Key rule: Attributes absent from the right side of all FDs must be in every candidate key.

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.