<aside>
◻️ Review of last lecture:
Deleting relations, large relations, data type, nested selects, views
</aside>
<aside>
🚧 Outline:
Normalization: update anomaly, insertion anomaly, deletion anomaly, first normal form, functional dependence, second normal form, and example
</aside>
*https://www.notion.so/lavendershuo/Lecture-18-Normalization-03a84694d3a64e54a5c0622ae4332bac*
WHAT IS A GOOD RELATION DESIGN?
We have seen how to create a new relation from a given schema.
We know that the following rules must apply to relations:
- Entity Integrity:
For each tuple in a relation attributes that belong to the primary key must be non-null
- Referential Integrity:
All foreign key attribute values in a relation must be either null or correspond to a primary key value
- Duplication of tuples in a relation is not allowed.
- Next, we look at: - Normalization
Normalization
Normalization is a technique used to organize the data in a database.
- Normalization consists of a set of rules that all relations must follow for a database(DB) to be well structured.
- These rules are presented as sets of restrictions called NORMAL FORMS
- NORMALIZATION is the process of creating a DB that complies with these restrictions. We do that by normalizing each of the relations.
- Normal forms
- 1NF (First Normal Form)
- 2NF (Second Normal Form)
- 3NF (Third Normal Form)
4NF, 5NF, 6NF...... It's not always a good idea to normalize beyond 3NF.