Open In App

Anomalies in Relational Model

Anomalies in the relational model refer to inconsistencies or errors that can arise when working with relational databases, specifically in the context of data insertion, deletion, and modification. There are different types of anomalies that can occur in referencing and referenced relations which can be discussed as:  

These anomalies can be categorized into three types:



How Are Anomalies Caused in DBMS?

Database anomalies are the faults in the database caused due to poor management of storing everything in the flat database. It can be removed with the process of Normalization, which generally splits the database which results in reducing the anomalies in the database.

STUDENT Table



STUD_NO STUD_NAME STUD_PHONE STUD_STATE STUD-COUNTRY STUD_AGE
1 RAM 9716271721 Haryana India 20
2 RAM 9898291281 Punjab India 19
3 SUJIT 7898291981 Rajasthan India 18
4 SURESH   Punjab India 21

Table 1

STUDENT_COURSE

STUD_NO COURSE_NO COURSE_NAME
1 C1 DBMS
2 C2 Computer Networks
1 C2 Computer Networks

 Table 2

Insertion Anomaly: If a tuple is inserted in referencing relation and referencing attribute value is not present in referenced attribute, it will not allow insertion in referencing relation. 

Example: If we try to insert a record in STUDENT_COURSE with STUD_NO =7, it will not allow it. 

Deletion and Updation Anomaly: If a tuple is deleted or updated from referenced relation and the referenced attribute value is used by referencing attribute in referencing relation, it will not allow deleting the tuple from referenced relation.

Example: If we want to update a record from STUDENT_COURSE with STUD_NO =1, We have to update it in both rows of the table. If we try to delete a record from STUDENT with STUD_NO =1, it will not allow it. 

To avoid this, the following can be used in query:

How These Anomalies Occur?

Removal of Anomalies

These anomalies can be avoided or minimized by designing databases that adhere to the principles of normalization. Normalization involves organizing data into tables and applying rules to ensure data is stored in a consistent and efficient manner. By reducing data redundancy and ensuring data integrity, normalization helps to eliminate anomalies and improve the overall quality of the database

According to E.F.Codd, who is the inventor of the Relational Database, the goals of Normalization include:

Advantages Anomalies in Relational Model

Disadvantages of Anomalies in Relational Model

Conclusion

Ensuring data integrity requires addressing anomalies such as insertion, update, and deletion problems in the Relational Model. By effectively arranging data, normalization techniques offer a solution that guarantees consistency and dependability in relational databases.

FAQs on Anomalies in Relational Model

Q.1: What is Normalization?

Answer:

Normalization is the process of splitting the tables into smaller ones so as to remove anomalies in the database. It helps in reducing redundancy in the database.

Q.2: What are Anomalies in the Relational Model?

Answer:

An anomaly is a fault that is present in the database which occurs because of the poor maintenance and poor storing of the data in the flat database. Normalization is the process of removing anomalies from the database.

Q.3: How Anomalies can be removed?

Answer:

Anomalies can be removed with the process of Normalization. Normalization involves organizing data into tables and applying rules to ensure data is stored in a consistent and efficient manner.


Article Tags :