🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › Web & Software Development › SQL and PostgreSQL Database Development › Lesson 3
TEC-WEB46-04 · Lesson 3 · 13 clock hours · theory

Normalization and Entity-Relationship Modeling

Objective. Students will apply first, second, and third normal form rules to decompose a denormalized dataset and produce a correct ER diagram.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

Why Database Design Matters

A poorly designed database causes real problems: duplicate data wastes storage, inconsistent updates corrupt records, and queries become needlessly complex. Normalization is the formal process of organizing a relational database so that data is stored in exactly one place and every piece of information depends logically on the correct key. Entity-Relationship (ER) modeling is the visual technique used to plan that structure before writing a single line of SQL.

These two skills—normalization and ER modeling—are foundational for every role that touches a database, from back-end developer to data analyst.

Understanding Anomalies in Unnormalized Data

Before applying normal forms, you need to recognize what goes wrong without them. There are three classic anomalies:

Normalization eliminates these anomalies by ensuring that each table represents exactly one subject.

First Normal Form (1NF)

A table is in First Normal Form when:

1. Every column holds only atomic (indivisible) values—no comma-separated lists or repeating groups inside a single cell.

2. Every row is unique, identified by a primary key.

Example violation: An `Orders` table with columns `OrderID`, `CustomerName`, `Items` where `Items` contains `"Keyboard, Mouse, Monitor"`. The `Items` column is not atomic. To reach 1NF, move each item to its own row in a separate `OrderItems` table linked by `OrderID`.

Second Normal Form (2NF)

A table is in Second Normal Form when it is already in 1NF and every non-key column is fully functionally dependent on the entire primary key—not just part of it. This rule only applies to tables with a composite primary key.

Example violation: An `OrderItems` table with primary key `(OrderID, ProductID)` and a column `ProductName`. `ProductName` depends only on `ProductID`, not on the combination of `OrderID` and `ProductID`. This is a partial dependency. To reach 2NF, move `ProductName` to a separate `Products` table keyed by `ProductID`.

Third Normal Form (3NF)

A table is in Third Normal Form when it is already in 2NF and no non-key column depends on another non-key column—there are no transitive dependencies.

Example violation: An `Orders` table with columns `OrderID` (PK), `CustomerID`, `CustomerCity`, `CustomerZip`. `CustomerCity` depends on `CustomerZip`, which is not the primary key. To reach 3NF, move `CustomerZip` and `CustomerCity` to a `Customers` table keyed by `CustomerID` (or a `ZipCodes` lookup table).

After applying 3NF, each table represents one entity, and every non-key column describes only that entity.

Entity-Relationship Modeling

An ER diagram is a blueprint of your normalized database. It shows entities, their attributes, and how they relate to one another.

Entities are the major subjects of the database—things worth storing data about, such as Customer, Order, Product, and Category. Each entity becomes a table.

Attributes are the facts recorded about an entity. The attribute that uniquely identifies each row is the primary key (usually underlined or marked PK in diagrams).

Relationships describe how entities connect. A Customer places Orders; an Order contains Products. Relationships are labeled with a verb and decorated with cardinality notation to show how many instances of one entity relate to instances of another.

Crow's-Foot Cardinality Notation

Crow's-foot notation uses symbols at each end of a relationship line:

Common cardinality patterns:

Always label the minimum and maximum cardinality (e.g., "zero or one" vs. "one and only one") to distinguish mandatory from optional participation.

Drawing the ER Diagram

Using draw.io or Lucidchart:

1. Create one rectangle (entity box) for each table identified after normalization.

2. List attributes inside the box; mark the primary key.

3. Draw a line between related entities.

4. Place crow's-foot symbols at the correct ends.

5. Label the relationship with a verb phrase.

Check your diagram against your normalized tables. Every foreign key in a table should correspond to a relationship line on the diagram.

Accuracy and Professional Practice

Errors in database design are expensive to fix after data accumulates. Always validate your ER diagram against the business rules in the requirements document, not just against your intuition. Peer review—checking a colleague's diagram—catches assumptions you made silently. When in doubt, ask a stakeholder to confirm the business rule before encoding it in a schema.

Key terms10

NormalizationThe process of structuring a relational database to reduce data redundancy and eliminate update, insertion, and deletion anomalies by applying a series of normal form rules.
First Normal Form (1NF)A table is in 1NF when every column contains only atomic (indivisible) values and every row is uniquely identified by a primary key; no repeating groups are allowed.
Second Normal Form (2NF)A table in 1NF reaches 2NF when every non-key column is fully functionally dependent on the entire composite primary key, eliminating partial dependencies.
Third Normal Form (3NF)A table in 2NF reaches 3NF when no non-key column depends on another non-key column; all transitive dependencies are removed.
Partial DependencyA situation in which a non-key column depends on only part of a composite primary key, violating 2NF.
Transitive DependencyA situation in which a non-key column depends on another non-key column rather than directly on the primary key, violating 3NF.
Entity-Relationship (ER) DiagramA visual model showing the entities in a database, their attributes, their primary keys, and the relationships between them, including cardinality.
Crow's-Foot NotationA diagramming style that uses a crow's-foot symbol (three diverging lines) to indicate the 'many' side of a relationship and a single bar to indicate the 'one' side.
Associative (Junction) TableA table created to resolve a many-to-many relationship between two entities by holding the primary keys of both as a composite key, creating two one-to-many relationships.
Functional DependencyA relationship between columns in which the value of one column (or set of columns) uniquely determines the value of another column; the basis for all normal form analysis.
In class: Given a spreadsheet of unnormalized order data (repeating groups, partial dependencies, transitive dependencies), students identify violations and iteratively apply 1NF, 2NF, and 3NF rules, documenting each transformation step. · Students draw an ER diagram for a provided business narrative (a small e-commerce site) using draw.io or Lucidchart, identifying entities, attributes, primary keys, and relationships with correct crow's-foot cardinality notation. · Peer-review activity: pairs exchange ER diagrams, check for normalization violations and missing relationships, then deliver a short verbal critique; instructor resolves disagreements against a model answer.
Materials: draw.io or Lucidchart (browser-based), normalization worksheet with sample denormalized dataset, instructor ER diagram rubric, Martin/Fowler relational modeling reference handout
Check: Submitted ER diagram is graded against a rubric: all entities identified, all relationships correct, all cardinalities labeled, schema is at least 3NF; pass = 80% of rubric points earned.

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

Database fundamentals / data modeling
1. A table called `OrderItems` has a composite primary key of `(OrderID, ProductID)`. The column `ProductName` is stored in this table and depends only on `ProductID`. Which normal form rule does this violate?
Database fundamentals / data modeling
2. An `Orders` table contains `OrderID` (PK), `CustomerID`, `CustomerZip`, and `CustomerCity`. `CustomerCity` is determined by `CustomerZip`, not by `OrderID`. Which anomaly type does this create?
Database fundamentals / data modeling
3. Which of the following table designs is the correct way to resolve a many-to-many relationship between `Students` and `Courses`?
Database fundamentals / data modeling
4. In crow's-foot notation, which symbol is placed at the 'many' end of a one-to-many relationship line?
Database fundamentals / data modeling
5. A spreadsheet row contains: `OrderID=101, CustomerName=Lee, Item1=Keyboard, Item2=Mouse, Item3=Monitor`. What is the FIRST step to bring this data to First Normal Form?
Database fundamentals / data modeling
6. Which of the following best describes a deletion anomaly in an unnormalized database?
Database fundamentals / data modeling
7. A business rule states: 'Each order must have exactly one customer, and a customer may have zero or more orders.' What is the correct crow's-foot cardinality between `Customer` and `Order`?
Database fundamentals / data modeling
8. After decomposing a denormalized table into 3NF, a developer notices that the ER diagram still shows a direct many-to-many line between two entity boxes with no junction entity. What should the developer do?
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.