This table mixes facts about students, courses and instructors:
class_list
| student_id | course_id | course_title | instructor | office |
|---|---|---|---|---|
| S1 | DB-1 | Databases | Dr. Hale | OT-210 |
| S2 | DB-1 | Databases | Dr. Hale | OT-210 |
| S4 | DB-1 | Databases | Dr. Hale | OT-210 |
| S3 | HI-3 | Art History | Dr. Lund | TR-300 |
Storing one fact many times is . It costs space, and it causes three kinds of error:
| Anomaly | What happens | In class_list |
|---|---|---|
| update | a change must reach every copy; if one copy is missed, the copies disagree | DB-1 gets a new title, one row keeps the old one |
| insert | you cannot store one fact without another | a new course with no student has no student_id for the key |
| delete | removing one fact removes another | S3 leaves HI-3; the only row with Dr. Lund's office goes too |
The cause is one table for facts about different things. The rest of this chapter shows how to find which facts belong together, and how to split the table so that each fact is stored once.