Home

Smells of Bad Design

If you see these, stop and rethink.

🔁
Repeating Columns

phone1, phone2, phone3...

Violates 1NF
🏷️
Name-Based Relationships

Linking tables by name, not ID

WHERE student_name = 'John'
🎭
Mixed Entities

One table storing students AND teachers

person_type = 'S' or 'T'
🕳️
Too Many NULLs

Half the cells are empty

Missing data or wrong table

Your nose knows. Trust the smell.

Why SQL Lies When ERD Is Wrong

SQL is obedient. It will run your bad design without complaint.

Day 1: SQL Runs

Your CREATE TABLE statements execute. No errors. Looks good!

📊

Month 3: Reports Are Wrong

Duplicate data, missing records, calculations don't match reality.

🐛

Year 2: Bugs Appear

Data corruption discovered. Fix requires rewriting half the system.

"If your ERD is wrong, SQL will lie to you."

SQL has no conscience. It executes what you wrote, not what you meant.

End of Week 2 Checklist

You should now be able to do these confidently:

YES — You Can Do These
Convert ERD to tables with proper keys
Choose correct primary keys (surrogate vs natural)
Resolve many-to-many with junction tables
Normalize to 3NF intuitively (atomic, whole key, no chains)
NOT YET — Still Forbidden
JOINs (Week 3)
Complex queries (Week 3)
Aggregation (Week 4)

The Discipline

"Week 2 was about structure.
Week 3 will be about retrieval.

You cannot retrieve well
from a structure that lies."

Foundation Complete
🧱

Structure

Week 2 Complete
Tables, Keys, Relations

🔍

Retrieval

Week 3 Coming
JOINs, Queries

📊

Analysis

Week 4 Coming
Aggregation, Reports

You Are Now
Thinking Relationally

Before: "I need to store some data"

After: "What are the entities? What are their relationships? What are the keys?"

This mindset is your superpower.

Week 3: JOINs → Week 4: Analysis → Week 5: Mastery

Slide 1 / 5