How do you teach database normalization?

前端 未结 9 1473
孤街浪徒
孤街浪徒 2020-12-06 13:58

What are your steps and guidelines for database normalization? If given a bunch of people with good computer and logic skills, how do you explain to them how to normalize a

相关标签:
9条回答
  • 2020-12-06 14:23

    One of the first lessons--and one of the most important--is that the normal forms apply to individual tables, not to databases. It makes sense to say, "The table 'wibble' is in BCNF", but it doesn't make sense to say "This database is in 3NF."

    I see two big problems very frequently in dealing with database developers.

    1. Trying to normalize a table based on column names rather than on representative sample data.
    2. Not understanding functional dependencies.

    Those two are interrelated, in that functional dependencies are defined in terms of values, not in terms of column names.

    0 讨论(0)
  • 2020-12-06 14:24

    Check out some of these resources:

    • 3 Normal Forms - a tutorial
    • Database normalization tutorial

    or get your folks the best book I've found for learning database design:

    Database Design for Mere Mortals(R): A Hands-On Guide to Relational Database Design (2nd Edition) by Mike Hernandez

    enter image description here

    0 讨论(0)
  • 2020-12-06 14:28

    Just go for 3nf and focus on rendundant data and everything will prety much be straight forward. Or you can go the completely wrong path and use E/R diagrams just to confuse the hell out of them!

    0 讨论(0)
  • 2020-12-06 14:28

    I find it far more important to teach good design (using join tables when appropriate, know when to use NULLs, when to use surrogate keys,...) and when this concept is clear, tell them: What you did is actually 1,2,3,...NF because of ...

    This way, the theory doesn't block you and you can design well databases and later know, wich NF it was.

    0 讨论(0)
  • 2020-12-06 14:35

    The way I was taught was building up from 1NF, 2NF 3NF BCNF etc, as sort of a history lesson type learning journey.

    It really depends on your audience, going straight to 3NF maybe a bit of a jump.

    0 讨论(0)
  • 2020-12-06 14:36

    one of my favorite references is Fundamentals of Relational Database Design

    0 讨论(0)
提交回复
热议问题