2. Disclaimer: This presentation is prepared by
trainees of baabtra as a part of mentoring
program. This is not official document of baabtra –
Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System
Technologies Pvt . Ltd
4. Database Anomalies
• Databases are designed to collect data and
sort or present it in specific ways to the end
user
• Database anomalies-unmatched or missing
information caused by limitations or flaws
within a given database
• Entering or deleting information cause issues
if the database is limited or has ‘bugs’.
5. Modification/Update Anomalies
• They are the data inconsistencies that resulted
from data redundancy or partial update.
• The Problems resulting from data redundancy in
database table are known as update anomalies.
• If a modification is not carried out on all the
relevant rows, the database will become
inconsistent
• Any database insertion, deletion or modification
that leaves the database in an inconsistent state
is said to have caused an update anomaly.
6. Insertion Anomalies
• Issues that come about when you are inserting
information into the database for the first time.
• To insert the information into the table
– Must enter the correct details
– Must be consistent with the values for the other rows.
– Missing or incorrectly formatted entries are two of the
more common insertion errors.
• Most developers acknowledge that this will
happen and build in error codes that tell you
exactly what went wrong.
7. Deletion Anomalies
• Issues with data being deleted either
– when attempting to delete and being stopped by an
error or
– by the unseen drop off of data
• If we delete a row from the table that represents
the last piece of data, the details about that piece
are also lost from the Database.
• These are the least likely to be caught or to stop
you from proceeding
• As many deletion errors go unnoticed for
extended periods of time, they could be the most
costly in terms of recovery
8. • Database anomalies are a fact
• we will all face them in one form or another in
life.
• The importance of
– backing up,
– storing offsite and
– data consistency checks
come into full focus when you consider what
could be lost.
9. Example
To understand why we should be careful in
designing databases, let's consider an example
of a bad database design
• Here the cust ID and stock are the primary key.
10. • Insertion Anomalies
– You may want to add information about a person with
whom you want to do business.
– The above table only allows information for customers that
own a share of stock.
– If the person does not own stock, then the last four
columns in the table have to be empty
– This is not allowed since stock is part of the primary
identifier
• Deletion Anomalies
– You may want to delete a record from the above table
because a customer sold his stock.
– Consider the second record.
– If this record were deleted, then information would be lost
about both Jones's address and the price of C stock.
11. • Update Anomalies
– You may want to update a customer's address, the
price of a stock, or its most recent dividend.
– To accomplish this update, you would have to
update several rows in the table.
– If you miss one of the rows that should be
updated, then at a later time you will get two
different answers to a question you ask of the
data.
– This is not good. Generally, if there is only
supposed to be one answer to a question, you
want to get just that one answer.
12. How To Avoid Anomalies??
• The use of normalization
• The goal of the normalization process is to
define relations
• So that each relation is about one kind of
thing. Not two. Not three. One.
• This seems like a reasonable condition, given
the problems that it prevents
13.
14. How Normalization works??
• If you know a customer id, then you know the
person's name and address.
• If you know a stock identifier, then you know
its current price and most recent dividend.
• Finally, for any pairing of a customer id and a
stock identifier, you know how many shares
that person owns of that stock
17. Did this presentation help you??? do visit our
page facebook.com/baabtra, And don’t forget
to like us.
• www.baabtra.com
• www.massbaab.com
• www.baabte.com