Thursday, June 24, 2021

Database Anomalies

 

What is Database Anomaly?

Database anomaly is normally the flaw in databases which occurs because of poor planning and storing everything in a flat database. Generally this is removed by the process of normalization which is performed by splitting/joining of tables.


Prof_ID

Prof_Name

Dept.

Course Group

39404

Ashish

Marketing

Sec A

39445

Sonam

Product

Sec B

43576

Anu Priya

Finance

Sec C

54325

Anu Priya

Finance

Sec C

99823

Anushka

HR

Sec D

14325

Anushka

HR

Sec E


There are three types of database anomalies:


a) Insertion anomaly: An insertion anomaly occurs when we are not able to insert certain attribute in the database without the presence of other attribute. For example suppose any professor is hired but not immediately assigned any course group or any department may not get his/her place in such type of flat database mentioned above, if null entries are not allowed in the database. So in the case mentioned above removing such type of problems requires splitting of the database which is done by normalization.


b) Update anomaly: This occurs in case of data redundancy and partial update. In other words a correct update of database needs other actions such as addition, deletion or both. For example in the above table the department assigned to Anushka is an error because it needs to be updated at two different place to maintain consistency.


c) Deletion Anomaly: Deletion anomaly occurs where deletion some data is deleted because of deletion of some other data. For example if Section B is to be deleted then un-necessarily Sonam’s detail has to be deleted. So normalization is generally done before deleting any record from a flat database.


Source : https://www.mbaskool.com/business-concepts/it-and-systems/12909-database-anomaly.html

No comments:

Followers

Link