First Normal Form (1NF)

Sub-Page 1: Atomic values and no repeating groups

1NF Rules

Each cell contains a single (atomic) value. No repeating groups. Unique records with primary key.

Member IDFull NameAddressSalutationMovies Rented
1Robert Phil123 Main StMr.Movie1, Movie2, Movie3
2Julie Thorn456 Oak AveMs.Movie4, Movie5
3Robert Phil789 Pine RdMr.Movie6

Functional Dependency for 2NF

Understanding functional dependencies is key to achieving Second Normal Form (2NF). A functional dependency occurs when one attribute uniquely determines another. For 2NF, all non-key attributes must fully depend on the entire primary key, not just part of it.

Example Functional Dependency

In the unnormalized table, Movies Rented is a multi-valued attribute. After 1NF, we split it into Movie ID and Movie Name. However, Movie Name depends only on Movie ID, not the full primary key (Member ID, Movie ID), indicating a partial dependency.

-- Partial Dependency in 1NF Table
Member ID, Movie ID → Full Name, Address, Salutation, Movie Name
Movie ID → Movie Name
                    

This partial dependency requires further normalization to achieve 2NF, covered in the next sub-page.

SQL for 1NF

-- SQL to create 1NF-compliant table
CREATE TABLE MemberMovies (
    MemberID INT,
    FullName VARCHAR(50),
    Address VARCHAR(100),
    Salutation VARCHAR(10),
    MovieID INT,
    MovieName VARCHAR(50),
    PRIMARY KEY (MemberID, MovieID)
);
                    

This schema ensures atomic values and a composite primary key, eliminating repeating groups like Movies Rented.

Key Takeaways

Atomic Values

1NF ensures each cell contains a single value, removing multi-valued attributes.

Primary Key

A unique identifier (or composite key) ensures no duplicate records.

Foundation for 2NF

1NF sets the stage for eliminating partial dependencies in 2NF.