Normalization isn't theory — it's fewer bug reports
Context
For the Relational Database Mini Project I had to design a schema and then write real queries against it — joins, grouping, aggregation. I expected the hard part to be SQL syntax. The hard part turned out to be deciding how the data should be shaped in the first place.
The problem: data that disagrees with itself
The classic failure mode is storing the same fact in more than one place. The moment a value — a name, a price, an address — lives in two tables, you have created two sources of truth. An update touches one copy and the other quietly drifts, and the report disagrees with the detail view. The bug isn't in any query; it's in the shape of the data. This is what database design calls an update anomaly.
The approach: normalize first
Normalization is the process of removing those redundancies: split the data so every fact lives in exactly one place, and link facts back together with foreign keys. For the project I modeled a small ordering system across five tables — users, orders, order_items, products, payments — normalized to third normal form.
Why the schema makes the queries simpler
JOIN, GROUP BY, and aggregation are only as good as the schema they run against. Clean up the schema and the queries read like English:
SELECT student_id, COUNT(*) AS enrollments
FROM enrollments
GROUP BY student_id
HAVING COUNT(*) > 3;
That's not clever SQL. It's SQL that's allowed to be simple because the schema already did the hard work. In a denormalized schema the same query would have to guard against duplicated rows inflating the count, or against stale copies of a value that has since been renamed.
What changed
Since this project I read every schema through the same lens: where can this data disagree with itself? That question now comes before writing a single query. Normalization stopped being a theory to apply and became the default shape I reach for when modeling data.
What I learned
A normalized schema is a design decision that pays compound interest: every future query is simpler, and every future bug is more likely to be caught by the database instead of the developer.
Practical takeaway
Before you write a JOIN, look at the schema. If the same value appears in two tables, you don't have a query problem — you have a data-modeling problem. Fix the shape of the data first, and the SQL follows.
Related project
Relational Database Mini Project
Explore project