Anomalies In detail

Let us take an example

In employee table attributes are eid,ename,car,parea (eid is the primary key)

Insertion Anomaly :


          Let us say for each car there is an allocated parking area. In order to hold that we need to make in an entry in table like this

                                                              null,null,Swift, A

Since null cannot assigned for eid. We call this as Insertion Anomaly.

Deletion Anomaly :

         Let us say that we have only one entry for swift car that is also associated with employee id 5.
Suppose he leaves the company we have to remove him from the table.

                                                              5, Arun, Swift,A

suppose we are removing Arun from the table we don't know parking area for Swift for further entries in the table. This is called deletion anomaly.

Updation Anomaly :


         Suppose parking lot for Swift is changed we have to update all the entries that comes with car value as Swift. If we fail to update any one of the tuple with car value as Swift we it as updation Anomaly.



Comments

Popular posts from this blog

Super and Candidate Key

Canonical Cover