What are the three types of anomalies in database and
Explain?

Answer Posted / a.h nayeem

INSERT Anomaly
1)An insertion anomaly occurs when data cannot be inserted into a database due to other missing data
2)This is most common for fields where a foreign key must not be NULL, but lacks the appropriate data
3)An example of this anomaly can be explained with a simple user database
..A user must have a group ID as a foreign key
..No groups have yet been created
..Thus, a user can not be inserted in to the database as the group ID must not be NULL
4)This can result in data redundancy due to the omission of data.


DELETE Anomaly
1)A deletion anomaly occurs when data is unintentionally lost due to the deletion of other data
2)For example, if a database row contained "Username" and "User Group"
.."John" and "Fred" are in the user group "Contributors"
..If John and Fred are removed from the database, our Contributors group will also disappear
..This is because we haven't normalised our data, meaning the only reference to the Contributors user group lies within the same database row (or record)
..Hence, removing the only two references of our user group results in the loss of data accuracy and integrity
3)This also goes to show why it's important for us to normalise our data and how combining unlike information can be problematic


UPDATE Anomaly
1)An update anomaly occurs when data is only partially updated in a database.
2)A database that hasn't undergone normalisation may reference the same data element in more than one location.
3)As these locations haven't been consolidated and referenced, we have to make sure each location is manually updated
4)This can cause problems as we then need to spend time searching for and updating each reference to the data element.
5)An example of this is a database containing two records; Users and Mailing List.
..John has an email address of john@mail.com in the Users record.
..John has the same email address in the Mailing List record.
..John decides to change his email preferences, which in turn updates the User record for John.
..However, the system did not automatically update the Mailing List record, leaving John with two different associated emails and thus creating inconsistencies within our database.

Is This Answer Correct ?    25 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can any one tell me how i can start database testing mean what should be initial point and how i can write a query for listing page of any item thanks in advance

2107


i applied prompt on country when i run report it shows list of all countries but want it to show only four countries name

1665


Differentiate between delete and truncate table?

633


First input columns brand, mt, re values are ov, 1,re vg, 2,re wu ,3,re. Second input columns are brand, mt, cx their records are ov,4,vg ,5,cx Wu, 6,cx and third input columns brand, mt, rt values are ov,7,rt vg, 8,rt wu, 9,rt but my output is brand, re, cx,rt values are ov, 1,4,7 vg, 2,5,8 wu, 3,6,9

1314


Differentiate between extension & intension?

879






Which database does facebook use?

523


What are the disadvantages of views in a database?

549


Please post the scenerois for writing the complex sql queries , for my practice.Can be any query if you cannot solve.

2076


Define stored procedure?

603


Explain artificial key?

743


What is a sequence? Explain it with one example?

651


What is ole db provider for sql server?

556


What is table scan and index scan?

620


Explain partial key?

658


what is transaction state, buffer management, shadow paging

2935