Difficulty: Easy
Correct Answer: third step.
Explanation:
Introduction / Context:
After identifying keys, the next task is to verify whether foreign keys truly reference valid primary keys and whether the data satisfies referential integrity (RI). This check confirms that relationships behave as intended and uncovers orphaned rows or modeling errors.
Given Data / Assumptions:
Concept / Approach:
RI validation typically occurs after hypothesizing foreign keys. Only then can you run anti-joins or NOT EXISTS checks to find child rows without matching parents. This positions RI validation naturally as the third step in a structured reverse-engineering workflow.
Step-by-Step Solution:
Verification / Alternative check:
Run SELECTs with LEFT JOIN and WHERE parent.key IS NULL to locate violations; count violations and sample rows to confirm.
Why Other Options Are Wrong:
Placing RI checks as the first or second step is premature before keys are identified; as fourth misses early detection of serious defects.
Common Pitfalls:
Inferring RI solely from column names; ignoring soft-deletion flags that break relationships.
Final Answer:
third step.
Discussion & Comments