Reverse-engineering an existing database: When assessing the structure of an acquired set of tables with data, determining the primary keys is (part of) the ________.

Difficulty: Easy

Correct Answer: first step.

Explanation:


Introduction / Context:
Reverse-engineering a database begins with understanding its identifiers and relationships. Primary keys uniquely identify rows and anchor the rest of the design analysis, so they are found at the start of the assessment process.



Given Data / Assumptions:

  • We have an existing set of tables with real data.
  • Documentation may be incomplete or outdated.
  • We need an ordered approach to rediscover schema intent.


Concept / Approach:

A sensible sequence is: (1) determine primary keys, (2) determine foreign keys, (3) assess referential integrity, and (4) analyze functional dependencies to guide normalization and clean-up. Identifying primary keys first clarifies entity boundaries and prevents confusion when evaluating foreign keys and dependencies later.



Step-by-Step Solution:

Scan candidate unique columns or combinations with no duplicates and no NULLs.Validate uniqueness against real data to confirm the primary key.Document discovered keys to support subsequent FK and dependency analysis.


Verification / Alternative check:

Run DISTINCT counts and NULL checks; the primary key should show count(rows) = count(DISTINCT key) and contain no NULLs.



Why Other Options Are Wrong:

Later steps rely on knowing the primary keys; placing this task second, third, or fourth is inefficient and error-prone.



Common Pitfalls:

Accepting surrogate IDs as sole keys without checking natural key constraints; overlooking composite keys already used by the data.



Final Answer:

first step.

More Questions from Database Design Using Normalization

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion