100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
SQL & Relational Databases
60 minbeginner

ER modelling and normalisation — 1NF, 2NF, 3NF

Entity-Relationship (ER) modelling is the design process that translates real-world business concepts into a relational schema before a single line of SQL is written. An ER diagram defines entities (things the business cares about — players, matches, venues), attributes (properties of those entities), and relationships (how entities are connected to each other). Normalisation is the complementary process that restructures a schema to eliminate redundancy and dependency anomalies, ensuring that each piece of data is stored in exactly one place. Both processes are prerequisites for a schema that can grow without introducing data inconsistency.

The three normal forms — 1NF, 2NF, and 3NF — define progressively stricter rules for eliminating different classes of data anomalies. A database in 1NF has no repeating groups and atomic values in every cell. A database in 2NF additionally has no partial dependencies — every non-key attribute depends on the full primary key. A database in 3NF additionally has no transitive dependencies — non-key attributes depend only on the primary key, not on other non-key attributes. Violating these rules leads to update anomalies, insertion anomalies, and deletion anomalies that corrupt data over time.

For data engineers, ER modelling and normalisation are foundational skills for two reasons. First, understanding normalisation theory explains why source OLTP databases are designed the way they are — the many small tables with foreign key relationships are a direct product of normalisation. Second, data engineers often design staging schemas and intermediate tables during pipeline development, and a normalised design prevents the data quality bugs that plague unnormalised pipelines: update anomalies in dimension tables, insertion anomalies in staging tables, and deletion anomalies in slowly changing dimension implementations.

Analogy🏏Cricket
🏏 Think of it like cricket: A SELECT query is precisely how a selection committee picks a playing XI. FROM is the full list of centrally contracted players — the raw pool. WHERE is the fitness and eligibility screen: injured or unavailable players are removed before anyone debates merit, and the fewer names that survive this screen, the faster the meeting goes — exactly why a good WHERE clause matters more than anything downstream. ORDER BY is ranking the survivors by recent form, then by experience as the tiebreaker. LIMIT 11 takes the top of that ranked list and stops. The committee never ranks the entire national player pool and then discards thousands of names — and neither should your query force the database to sort millions of rows it will immediately throw away. The order of operations is the whole game: filter first, sort what remains, take only what you need.
Lesson 13 of 32
0% complete