SlideShare ist ein Scribd-Unternehmen logo
1 von 18
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
ANOMALIES IN DATABASES


            vishnu.padinjattedath@gmail.com
                             @Vishnu_Kishor
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’.
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.
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.
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
• 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.
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.
• 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.
• 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.
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
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
QUESTIONS ARE GUARANTEED IN
LIFE BUT ANSWERS ARE NOT…!!
             .
             .


     ANY QUESTIONS????
THANK YOU
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
Contact Us

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbms
sethu pm
 

Was ist angesagt? (20)

Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
REQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGREQUIREMENT ENGINEERING
REQUIREMENT ENGINEERING
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
 
Introduction & history of dbms
Introduction & history of dbmsIntroduction & history of dbms
Introduction & history of dbms
 
Normal forms
Normal formsNormal forms
Normal forms
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Software requirements
Software requirementsSoftware requirements
Software requirements
 
Bcnf
BcnfBcnf
Bcnf
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Denormalization
DenormalizationDenormalization
Denormalization
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
Data independence
Data independenceData independence
Data independence
 
File allocation methods (1)
File allocation methods (1)File allocation methods (1)
File allocation methods (1)
 
Database Administration
Database AdministrationDatabase Administration
Database Administration
 
Integrity constraints in dbms
Integrity constraints in dbmsIntegrity constraints in dbms
Integrity constraints in dbms
 
DDL And DML
DDL And DMLDDL And DML
DDL And DML
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
3 Level Architecture
3 Level Architecture3 Level Architecture
3 Level Architecture
 
DBMS Integrity rule
DBMS Integrity ruleDBMS Integrity rule
DBMS Integrity rule
 

Ähnlich wie Database anomalies

Sfsvsqlug june-2010
Sfsvsqlug june-2010Sfsvsqlug june-2010
Sfsvsqlug june-2010
datamodeling
 
Database and Data Warehousing-Building Business Intelligence
Database and Data Warehousing-Building Business IntelligenceDatabase and Data Warehousing-Building Business Intelligence
Database and Data Warehousing-Building Business Intelligence
Yeng Ferraris Portes
 

Ähnlich wie Database anomalies (20)

17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
17.INTRODUCTION TO SCHEMA REFINEMENT.pptx
 
INTRODUCTION TO RDBMS
INTRODUCTION TO RDBMSINTRODUCTION TO RDBMS
INTRODUCTION TO RDBMS
 
How Data Analysis can enhance your Business
How Data Analysis can enhance your BusinessHow Data Analysis can enhance your Business
How Data Analysis can enhance your Business
 
Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)
 
Data modeling tips from the trenches
Data modeling tips from the trenchesData modeling tips from the trenches
Data modeling tips from the trenches
 
Root cause analysis
Root cause analysisRoot cause analysis
Root cause analysis
 
10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution10 Ways to Get More from Your Pardot Solution
10 Ways to Get More from Your Pardot Solution
 
Root cause analysis
Root cause analysis Root cause analysis
Root cause analysis
 
Doing Analytics Right - Building the Analytics Environment
Doing Analytics Right - Building the Analytics EnvironmentDoing Analytics Right - Building the Analytics Environment
Doing Analytics Right - Building the Analytics Environment
 
CaseStudy.pptx
CaseStudy.pptxCaseStudy.pptx
CaseStudy.pptx
 
Geek Sync | Why Did My Clever Index Change Backfire?
Geek Sync | Why Did My Clever Index Change Backfire?Geek Sync | Why Did My Clever Index Change Backfire?
Geek Sync | Why Did My Clever Index Change Backfire?
 
Sfsvsqlug june-2010
Sfsvsqlug june-2010Sfsvsqlug june-2010
Sfsvsqlug june-2010
 
Microsoft SQL Server Seven Deadly Sins of Database Design
Microsoft SQL Server Seven Deadly Sins of Database DesignMicrosoft SQL Server Seven Deadly Sins of Database Design
Microsoft SQL Server Seven Deadly Sins of Database Design
 
Declutter Your Database in 12 Steps.pdf
Declutter Your Database in 12 Steps.pdfDeclutter Your Database in 12 Steps.pdf
Declutter Your Database in 12 Steps.pdf
 
Unit 3 part ii Data mining
Unit 3 part ii Data miningUnit 3 part ii Data mining
Unit 3 part ii Data mining
 
Database and Data Warehousing-Building Business Intelligence
Database and Data Warehousing-Building Business IntelligenceDatabase and Data Warehousing-Building Business Intelligence
Database and Data Warehousing-Building Business Intelligence
 
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...
ALIGNING YOUR BI OPERATIONS WITH YOUR CUSTOMERS' UNSPOKEN NEEDS, by Eyal Stei...
 
Exception & Database
Exception & DatabaseException & Database
Exception & Database
 
Usability and Salesforce - Dallas Salesforce.com User Group September 2011
Usability and Salesforce - Dallas Salesforce.com User Group September 2011Usability and Salesforce - Dallas Salesforce.com User Group September 2011
Usability and Salesforce - Dallas Salesforce.com User Group September 2011
 
Database Testing
Database TestingDatabase Testing
Database Testing
 

Mehr von baabtra.com - No. 1 supplier of quality freshers

Mehr von baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Database anomalies

  • 1.
  • 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
  • 3. ANOMALIES IN DATABASES vishnu.padinjattedath@gmail.com @Vishnu_Kishor
  • 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
  • 15. QUESTIONS ARE GUARANTEED IN LIFE BUT ANSWERS ARE NOT…!! . . ANY QUESTIONS????
  • 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