Normalization is the process of systematically decomposing (splitting) a table into smaller tables to overcome the following problems:
- Spurious Tuples
- Anomalies
- Data Redundancy
| S.No | Objective |
|---|---|
| 1 | Eliminate Data Redundancy |
| 2 | Remove Anomalies |
| 3 | Avoid Spurious Tuples |
| 4 | Improve Data Consistency |
| 5 | Improve Database Design |
Spurious Tuples are tuples that are not present in the original table, but are generated when tables are decomposed and joined improperly.
| A | B |
|---|---|
| a1 | b1 |
| a2 | b2 |
| a3 | b3 |
| A | B | C |
|---|---|---|
| a1 | b1 | c1 |
| a2 | b2 | c2 |
| a3 | b3 | c3 |
| B | C |
|---|---|
| b1 | c1 |
| b2 | c1 |
| b2 | c2 |
| A | B | C |
|---|---|---|
| a1 | b1 | c1 |
| a2 | b2 | c1 |
| a2 | b2 | c2 |
| a3 | b2 | c1 |
| a3 | b2 | c2 |
Table 2
+-----------+
| A B C |
+-----------+
/ \
/ \
/ \
Table 1 Table 4
+-------+ +-------+
| A B | | B C |
+-------+ +-------+
\ /
\ /
\ /
+-----------+
| Table 3 |
| A B C |
+-----------+
Table 2 decomposes into Table 1 and Table 4.
Joining Table 1 and Table 4 creates Table 3,
which contains unwanted rows called Spurious Tuples.
Anomalies are problems that occur in a table while performing DML operations such as:
- INSERT
- UPDATE
- DELETE
| S.No | Anomaly |
|---|---|
| 1 | Insert Anomaly |
| 2 | Update Anomaly |
| 3 | Delete Anomaly |
Occurs when certain information cannot be inserted into the table without inserting some other information.
You cannot insert a Department if no Employee exists in that department.
Occurs when the same information is repeated in multiple rows and needs to be updated everywhere.
If Department Name changes:
IT → Information Technology
You must update all rows containing IT.
Occurs when deleting one record unintentionally removes other important information.
Deleting the last employee of a department may remove department information completely.
Repetition of the same data multiple times resulting in memory wastage is called Data Redundancy.
| EMP_ID | EMP_NAME | DEPT_NAME |
|---|---|---|
| 101 | Akash | IT |
| 102 | John | IT |
| 103 | Shashi | IT |
Here,
IT is repeated multiple times.
This repetition is called Data Redundancy.
If one attribute determines the value of another attribute, then the first attribute is called a Determinant.
EMP_ID → EMP_NAME
EMP_ID determines EMP_NAME.
Therefore,
EMP_ID is the Determinant.
If one attribute depends on another attribute, then it is called Functional Dependency.
STUDENT_ID → STUDENT_NAME
Meaning:
For each STUDENT_ID there is exactly one STUDENT_NAME.
| Functional Dependency |
|---|
| EMP_ID → EMP_NAME |
| EMP_ID → SALARY |
| STUDENT_ID → NAME |
| COURSE_ID → COURSE_NAME |
Determinant
|
↓
EMP_ID ----------> EMP_NAME
EMP_NAME is Functionally Dependent on EMP_ID
EMP_ID is Determinant
| Topic | Description |
|---|---|
| Normalization | Process of decomposing tables |
| Spurious Tuples | Unwanted tuples generated after join |
| Insert Anomaly | Unable to insert data independently |
| Update Anomaly | Multiple updates required |
| Delete Anomaly | Loss of important data |
| Data Redundancy | Repetition of same data |
| Determinant | Attribute determining another attribute |
| Functional Dependency | Dependency between attributes |