Knowledge Guide
HomeDatabasesNormalization

Solution to Exercise 2

Step 1: Check for First Normal Form (1NF)

To determine if the given table is in 1NF, we need to ensure:

  1. Each column contains atomic values (no multivalued or composite attributes).
  2. Each row is unique and identifiable by a primary key.

Given Table:

Emp_IDEmp_NameDOBAreaCityStateZip
101Alice1990-05-01DowntownNew YorkNY10001
102Bob1988-08-12MidtownNew YorkNY10002
103Charlie1992-11-23CentralLos AngelesCA90001
104David1985-03-15West EndChicagoIL60601

Conclusion:

Step 2: Check for Second Normal Form (2NF)

To determine if the table is in 2NF, we need to:

  1. Ensure the table is already in 1NF.
  2. Ensure there are no partial dependencies, where a non-key attribute depends only on part of a composite primary key.

Primary Key:

Dependencies:

Conclusion:

Step 3: Check for Third Normal Form (3NF)

To determine if the table is in 3NF, we need to:

  1. Ensure the table is already in 2NF.
  2. Ensure there are no transitive dependencies, where a non-key attribute depends on another non-key attribute rather than directly on the primary key.

Dependencies:

Conclusion:

Step 4: Convert to Third Normal Form (3NF)

To remove the transitive dependency, we need to:

  1. Create a separate table for the location details (dependent on Zip).
  2. Retain a reference to Zip in the original table.

Employee Table

This table will store employee-specific information, with Zip as a foreign key.

Emp_ID (PK)Emp_NameDOBZip
101Alice1990-05-0110001
102Bob1988-08-1210002
103Charlie1992-11-2390001
104David1985-03-1560601

Explanation:

Location Table

This table will store the location details based on Zip.

Zip (PK)AreaCityState
10001DowntownNew YorkNY
10002MidtownNew YorkNY
90001CentralLos AngelesCA
60601West EndChicagoIL

Explanation:

Final Relational Model

After normalization:

  1. Employee Table:

    • Contains Emp_ID, Emp_Name, DOB, and Zip.
    • No transitive dependencies exist in this table.
  2. Location Table:

    • Contains Zip, Area, City, and State.
    • Location details are fully normalized and uniquely identified by Zip.
🤖 Don't fully get this? Learn it with Claude

Stuck on Solution to Exercise 2? Open Claude, copy a block below, and it'll teach you this exact concept — visually and interactively.

🪜 Hint ladder (no spoilers)

Progressively stronger hints — you still solve it.

I'm working on the problem **Solution to Exercise 2** (Databases). Give me a HINT LADDER: start with the tiniest nudge, then wait. Only reveal the next, stronger hint when I ask. Do NOT show the full solution unless I type 'show solution'. Keep me doing the thinking. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🎨 Explain the approach visually

See the technique, not just code.

Explain the optimal approach to **Solution to Exercise 2** with a VISUAL walkthrough: trace it on a small concrete example using ASCII art / a step-by-step diagram, narrate what changes each step, then give time & space complexity with a one-line derivation. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🔍 Review my solution

Catch bugs, edge cases, sub-optimality.

I'll paste my solution to **Solution to Exercise 2**. Review it for correctness, missed edge cases, and time/space complexity, then coach me toward the optimal — don't just rewrite it. Ask me to paste my code now. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.
🔁 Drill the pattern

Lock in recognition with look-alikes.

Give me 2 problems that use the SAME underlying pattern as **Solution to Exercise 2**. For each, let me attempt first, then review my answer and name the trigger signal that reveals the pattern. If you're unsure or a claim isn't standard, say so and reason from first principles instead of guessing.

📝 My notes