Simple rules for database design

Ranae Dietzel & Andee Kaplan

Normalization and other tricks

Relationship vs. Attribute

An attribute can hide a relationship and relationships can be “downgraded” to an attribute.

Normal forms

Normalization is a relational database concept that describes the shapes of tables and rules that tables must follow. If you have created a “normalized” entity-relationship data model, then the tables created during design will conform to the rules of normalization.

First normal form (1NF)

Second normal form (2NF) and Third normal form (3NF)

The key, the whole key, and nothing but the key, so help me Codd.

Fourth (4NF) & fifth (5NF) normal forms

Usually 3NF is enough when modeling real data.

Modeling change

Every update of an attribute or transfer of a relationship means potential loss of information. Often that information is no longer of use, but some systems need to keep track of some or all of the old values of an attribute. This may lead to an explicit time dimension in the model.

Types of change

As always, there is a price for adding things such as this. Adding a time dimension to your conceptual data model makes the model considerably more complex. Think constraints.

Date entity vs. attribute

Slowly changing dimensions

Learning is easy, doing is hard

What are some lessons I can give you about actually doing this?

  1. Draw an ERD
    • Start with entities, then think about relationships, then add attributes
    • Think about the granularity of your tables (What does one row of data represent?)
    • Are you missing (dropping) any pieces of data?
  2. Edit your ERD, explain it to a (imaginary?) friend
  3. Think about some questions you have to answer with your data. Can you answer those questions?
  4. How difficult will it be for your database to adapt? Can you make it more flexible now?