Normalization & Database Design Principles: Functions
Module: Foundational Concepts
-- Unnormalized (0NF): Customer email in every order row
-- 1NF: Atomic values, separate rows for order items
-- 2NF: Customer info in ORDERS table
-- 3NF: Product info in PRODUCTS table
-- Result: Each fact stored once, update in one place
1NF: Atomic values, no repeating groups
2NF: 1NF + no partial dependencies
3NF: 2NF + no transitive dependencies
BCNF: Every determinant is candidate key
Junction tables for many-to-many
Excellent support for normalization, foreign keys, constraints
InnoDB engine required for foreign keys
Full normalization support with constraints
Core references in this topic include BETWEEN, ANY / ALL, ROWS / RANGE. Learn what each one does, when to use it, and the execution or engine rules that matter.
BETWEEN
Checks whether a value falls inside an inclusive lower/upper range.
order_total BETWEEN 100 AND 500
ANY / ALL
Compares one value against every or at least one value from a subquery result.
salary > ALL (SELECT salary FROM interns)
ROWS / RANGE
Defines how a window frame is sliced around the current row.
ROWS BETWEEN 3 PRECEDING AND CURRENT ROW
1NF: Atomic values, no repeating groups
2NF: 1NF + no partial dependencies
3NF: 2NF + no transitive dependencies
BCNF: Every determinant is candidate key
Junction tables for many-to-many
Normalize to 3NF for most applications
Denormalize only after measuring performance
Use foreign keys to maintain relationships
Document denormalization decisions
Test with realistic data volumes
Normalized: Better writes, more joins
Denormalized: Faster reads, redundant data
Measure before denormalizing
Consider materialized views for reporting
Over-normalizing (beyond 3NF rarely needed)
Denormalizing prematurely without measurements
Storing comma-separated values (violates 1NF)