Data Redundancy | Data Inconsistency |
When Same data located in multiple places in the database table, then the data is called redundant data. | Data Inconsistency is a condition that occurs when data redundancy occurs. |
To minimize the Data Redundancy, we need to normalize the database tables | To minimize Data Inconsistency, we need to use constraints on the database |
Disadvantages of Data Redundancy
- Data redundancy makes data retrieving less efficient due to occurring inconsistencies and increasing load on hardware due to irrelevant increase of data in tables.
- Data redundancy consumes more resources in the database.
- In some cases at beginning and more likely from time to time when database table size increase with a huge amount of data, then data redundancy makes database corrupted and corrupted data can cause the data to be unusable.
Problem of Data Redundancy
Student_ID | Student_Name | Teacher_id | Teacher_Name |
1 | Irum | 1 | Shehla |
2 | Sajid | 2 | Kiran |
3 | Javed | 1 | Shehla |
The student 1 and 3 are learning from teacher Shehla, and student 2 is learning from teacher Kiran. Here, the Teacher_id and Teacher_name repeats two times.
Solution of Data Redundancy
Teacher_id and teacher name can be stored into a separate table. New student table and the teacher table are as follows.
Student_ID | Student_Name | Teacher_id |
1 | Irum | 1 |
2 | Sajid | 2 |
3 | Javed | 1 |
Teacher_id | Teacher_Name |
1 | Shehla |
2 | Kiran |
Data Inconsistency
Suppose we want to Change the Teacher_Name from Shehla to Shehla khan. Mistaken we don’t change it on all rows, Only one record will have correct data while the others will have false data. Hence, this condition is data inconsistency.
Problem of Data Inconsistency
Student_ID | Student_Name | Teacher_id | Teacher_Name |
1 | Irum | 1 | Shehla |
3 | Javed | 1 | Shehla |
Student_ID | Student_Name | Teacher_id | Teacher_Name |
1 | Irum | 1 | Shehla Khan |
3 | Javed | 1 | Shehla |
Solution of Data Inconsistency
Teacher_id and teacher name can be stored into a separate table. New student table and the teacher table are as follows.
Student_ID | Student_Name | Teacher_id |
1 | Irum | 1 |
2 | Sajid | 2 |
3 | Javed | 1 |
Teacher_id | Teacher_Name |
1 | Shehla |
2 | Kiran |